Class Facebooker::FqlMultiquery
In: lib/facebooker/parser.rb
Parent: Parser

Methods

process  

Public Class methods

[Source]

# File lib/facebooker/parser.rb, line 533
    def self.process(data)
      root = element('fql_multiquery_response', data)
      root.children.reject { |child| child.text? }.map do |elm|
        elm.children.reject { |child| child.text? }.map do |query|
          if 'name' == query.name
            query.text
          else
            list = query.children.reject { |child| child.text? }
            if list.length == 0
              []
            else
              [list.first.name, array_of_hashes(query, list.first.name)]
            end
          end
        end
      end
    end

[Validate]