Module: FbGraph2::Edge::AppLinkHosts

Included in:
App
Defined in:
lib/fb_graph2/edge/app_link_hosts.rb

Instance Method Summary collapse

Instance Method Details



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fb_graph2/edge/app_link_hosts.rb', line 11

def app_link_host!(params = {})
  jsonized_params = params.inject({}) do |jsonized_params, (key, value)|
    jsonized_param = case value
    when Hash, Array
      value.to_json
    else
      value
    end
    jsonized_params.merge! key => jsonized_param
  end
  host = self.post jsonized_params, edge: :app_link_hosts
  AppLinkHost.new(host[:id], params.merge(host)).authenticate self.access_token
end


4
5
6
7
8
9
# File 'lib/fb_graph2/edge/app_link_hosts.rb', line 4

def app_link_hosts(params = {})
  hosts = self.edge :app_link_hosts, params
  hosts.collect! do |host|
    AppLinkHost.new(host[:id], host).authenticate self.access_token
  end
end