Module: FbGraph::Connections::Accounts

Included in:
User
Defined in:
lib/fb_graph/connections/accounts.rb

Instance Method Summary collapse

Instance Method Details

#accounts(options = {}) ⇒ Object

Fetching Pages owned by the current user.

If the manage_pages permission has been granted, this connection also yields access_tokens that can be used to query the Graph API on behalf of the page.

ref) developers.facebook.com/docs/reference/api/user

FbGraph::User.me(ACCESS_TOKEN).accounts
=> array of FbGraph::Page


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

def accounts(options = {})
  accounts = self.connection(:accounts, options)
  accounts.map! do ||
    [:access_token] ||= options[:access_token] || self.access_token
    FbGraph::Page.new(.delete(:id), )
  end
end