Class: FbGraph::Page

Direct Known Subclasses

Klass, Place

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

Methods included from Searchable

search, search, search_query_param

Methods included from CategoryAttributes

included, #initialize_with_category_specific_attributes

Methods included from Connections::Offers

#offer!, #offers

Methods included from Connections::Videos

#video!, #videos

Methods included from Connections::Tagged

#tagged

Methods included from Connections::Tabs

#tab!, #tab?, #tab_for_app, #tabs

Methods included from Connections::Statuses

#statuses

Methods included from Connections::Settings

#disable!, #enable!, included, #settings

Methods included from Connections::Questions

#question!, #questions

Methods included from Connections::PromotablePosts

#promotable_posts

Methods included from Connections::Posts

#posts

Methods included from Connections::Picture::Updatable

#picture!

Methods included from Connections::Picture

#picture

Methods included from Connections::Photos

#photo!, #photos

Methods included from Connections::Notes

#note!, #notes

Methods included from Connections::Milestones

#milestone!, #milestones

Methods included from Connections::Links

#link!, #links

Methods included from Connections::Likes

#likes

Methods included from Connections::Insights

#insights

Methods included from Connections::Groups

#groups

Methods included from Connections::Feed

#feed, #feed!

Methods included from Connections::Events

#event!, #events

Methods included from Connections::Conversations

#conversations

Methods included from Connections::Checkins

#checkin!, #checkins

Methods included from Connections::Blocked

#block!, #blocked, #blocked?, #unblock!

Methods included from Connections::Albums

#album!, #albums

Methods included from Connections::Admins

#admin?

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(options = {})
  access_token = get options.merge(:fields => "access_token")
  self.access_token = Rack::OAuth2::AccessToken::Legacy.new access_token
end