Method: FbGraph::Searchable#search

Defined in:
lib/fb_graph/searchable.rb

#search(query, options = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/fb_graph/searchable.rb', line 12

def search(query, options = {})
  type = self.to_s.underscore.split('/').last
  Searchable.search(query, options.merge(:type => type, :class => self)) do |collection|
    collection.map! do |obj|
      self.new(obj[:id], obj.merge(
        :access_token => options[:access_token]
      ))
    end
  end
end