Class: FbGraph::Page

Inherits:
Node
  • Object
show all
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

Direct Known Subclasses

Klass, Place

Defined Under Namespace

Modules: CategoryAttributes

Constant Summary

@@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

- (Page) initialize(identifier, attributes = {})



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

- (Object) get_access_token(options = {}) 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