Class: FbGraph::Page
- Extended by:
- Searchable
- Includes:
- Connections::Admins, Connections::Albums, Connections::Blocked, Connections::Checkins, Connections::Conversations, Connections::Events, Connections::Feed, Connections::Groups, Connections::Insights, Connections::Likes, Connections::Links, Connections::Milestones, Connections::Notes, Connections::Offers, Connections::Photos, Connections::Picture, Connections::Picture::Updatable, Connections::Posts, Connections::PromotablePosts, Connections::Questions, Connections::Settings, Connections::Statuses, Connections::Tabs, Connections::Tagged, Connections::Videos, CategoryAttributes
- Defined in:
- lib/fb_graph/page.rb,
lib/fb_graph/page/category_attributes.rb
Defined Under Namespace
Modules: CategoryAttributes
Constant Summary collapse
- @@attributes =
{ :raw => [:name, :username, :category, :link, :talking_about_count, :perms, :is_published, :can_post], :custom => [:cover, :like_count] }
Constants included from Connections::Settings
Connections::Settings::AVAILABLE_SETTINGS
Instance Attribute Summary
Attributes inherited from Node
#access_token, #endpoint, #identifier, #raw_attributes
Instance Method Summary collapse
- #get_access_token(options = {}) ⇒ Object (also: #page_access_token)
-
#initialize(identifier, attributes = {}) ⇒ Page
constructor
A new instance of Page.
Methods included from Searchable
search, search, search_query_param
Methods included from CategoryAttributes
included, #initialize_with_category_specific_attributes
Methods included from Connections::Offers
Methods included from Connections::Videos
Methods included from Connections::Tagged
Methods included from Connections::Tabs
#tab!, #tab?, #tab_for_app, #tabs
Methods included from Connections::Statuses
Methods included from Connections::Settings
#disable!, #enable!, included, #settings
Methods included from Connections::Questions
Methods included from Connections::PromotablePosts
Methods included from Connections::Posts
Methods included from Connections::Picture::Updatable
Methods included from Connections::Picture
Methods included from Connections::Photos
Methods included from Connections::Notes
Methods included from Connections::Milestones
Methods included from Connections::Links
Methods included from Connections::Likes
Methods included from Connections::Insights
Methods included from Connections::Groups
Methods included from Connections::Feed
Methods included from Connections::Events
Methods included from Connections::Conversations
Methods included from Connections::Checkins
Methods included from Connections::Blocked
#block!, #blocked, #blocked?, #unblock!
Methods included from Connections::Albums
Methods included from Connections::Admins
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Page
Returns a new instance of Page.
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/fb_graph/page.rb', line 37 def initialize(identifier, attributes = {}) super @@attributes[:raw].each do |key| self.send :"#{key}=", attributes[key] end @link ||= "https://www.facebook.com/#{username || identifier}" @like_count = attributes[:likes] || attributes[:fan_count] @cover = if (cover = attributes[:cover]) Cover.new cover[:cover_id], cover end end |
Instance Method Details
#get_access_token(options = {}) ⇒ Object Also known as: page_access_token
49 50 51 52 |
# File 'lib/fb_graph/page.rb', line 49 def get_access_token( = {}) access_token = get .merge(:fields => "access_token") self.access_token = Rack::OAuth2::AccessToken::Legacy.new access_token end |