Module: FbGraph::Connections::Links

Included in:
Application, Page, User
Defined in:
lib/fb_graph/connections/links.rb

Instance Method Summary collapse

Instance Method Details

#link!(options = {}) ⇒ Object



13
14
15
16
17
18
# File 'lib/fb_graph/connections/links.rb', line 13

def link!(options = {})
  link = post(options.merge(:connection => 'links'))
  Link.new(link.delete(:id), options.merge(link).merge(
    :access_token => options[:access_token] || self.access_token
  ))
end


4
5
6
7
8
9
10
11
# File 'lib/fb_graph/connections/links.rb', line 4

def links(options = {})
  links = self.connection(:links, options)
  links.map! do |link|
    Link.new(link.delete(:id), link.merge(
      :access_token => options[:access_token] || self.access_token
    ))
  end
end