Module: FbGraph::Connections::Accounts
- Included in:
- User
- Defined in:
- lib/fb_graph/connections/accounts.rb
Instance Method Summary collapse
-
#accounts(options = {}) ⇒ Object
Fetching Pages owned by the current user.
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( = {}) accounts = self.connection(:accounts, ) accounts.map! do |account| account[:access_token] ||= [:access_token] || self.access_token FbGraph::Page.new(account.delete(:id), account) end end |