Class: Facebooker::FqlMultiquery

Inherits:
Parser
  • Object
show all
Defined in:
lib/facebooker/parser.rb

Overview

nodoc

Constant Summary

Constants inherited from Parser

Parser::PARSERS

Class Method Summary collapse

Methods inherited from Parser

anonymous_field_from, array_of, array_of_hashes, array_of_text_values, booleanize, element, hash_or_value_for, hashinate, parse

Class Method Details

.process(data) ⇒ Object



414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
# File 'lib/facebooker/parser.rb', line 414

def self.process(data)
  root = element('fql_multiquery_response', data)
  root.elements.collect do |elm|
    [
     elm.elements[1].text,
      if elm.elements[2].elements[1].nil?
        [] 
      else
        [
         elm.elements[2].elements[1].name,
         array_of_hashes(elm.elements[2], elm.elements[2].elements[1].name)
        ]
      end
    ]
  end
end