Class: Facebooker::AreFriends

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, element, hash_or_value_for, hashinate, parse

Class Method Details

.process(data) ⇒ Object



422
423
424
425
426
427
# File 'lib/facebooker/parser.rb', line 422

def self.process(data)
  array_of_hashes(element('friends_areFriends_response', data), 'friend_info').inject({}) do |memo, hash|
    memo[[Integer(hash['uid1']), Integer(hash['uid2'])].sort] = are_friends?(hash['are_friends'])
    memo
  end
end