Class: FbGraph::Application

Instance Attribute Summary collapse

Attributes inherited from Node

#access_token, #endpoint, #identifier

Instance Method Summary collapse

Methods included from Connections::Videos

#video!, #videos

Methods included from Connections::TestUsers

#test_user!, #test_users

Methods included from Connections::Tagged

#tagged

Methods included from Connections::Subscriptions

#subscribe!, #subscriptions, #unsubscribe!

Methods included from Connections::Statuses

#statuses

Methods included from Connections::Reviews

#reviews

Methods included from Connections::Posts

#posts

Methods included from Connections::Picture

#picture

Methods included from Connections::Photos

#photo!, #photos

Methods included from Connections::Payments

#payments

Methods included from Connections::Notes

#note!, #notes

Methods included from Connections::Links

#link!, #links

Methods included from Connections::Insights

#insights

Methods included from Connections::Feed

#feed, #feed!

Methods included from Connections::Events

#event!, #events

Methods included from Connections::Albums

#album!, #albums

Methods included from Connections::Accounts

#accounts

Methods inherited from Node

#connection, #destroy, fetch, #fetch, #update

Methods included from Comparison

#==

Constructor Details

#initialize(client_id, attributes = {}) ⇒ Application

Returns a new instance of Application.



23
24
25
26
27
28
29
30
# File 'lib/fb_graph/application.rb', line 23

def initialize(client_id, attributes = {})
  super
  @name         = attributes[:name]
  @description  = attributes[:description]
  @category     = attributes[:category]
  @link         = attributes[:link]
  @secret       = attributes[:secret]
end

Instance Attribute Details

#categoryObject

Returns the value of attribute category.



21
22
23
# File 'lib/fb_graph/application.rb', line 21

def category
  @category
end

#descriptionObject

Returns the value of attribute description.



21
22
23
# File 'lib/fb_graph/application.rb', line 21

def description
  @description
end

Returns the value of attribute link.



21
22
23
# File 'lib/fb_graph/application.rb', line 21

def link
  @link
end

#nameObject

Returns the value of attribute name.



21
22
23
# File 'lib/fb_graph/application.rb', line 21

def name
  @name
end

#secretObject

Returns the value of attribute secret.



21
22
23
# File 'lib/fb_graph/application.rb', line 21

def secret
  @secret
end

Instance Method Details

#access_token_with_auto_fetchObject



38
39
40
41
# File 'lib/fb_graph/application.rb', line 38

def access_token_with_auto_fetch
  access_token_without_auto_fetch ||
  self.secret && get_access_token
end

#get_access_token(secret = nil) ⇒ Object



32
33
34
35
36
# File 'lib/fb_graph/application.rb', line 32

def get_access_token(secret = nil)
  self.secret ||= secret
  auth = Auth.new(self.identifier, self.secret)
  self.access_token = auth.client.access_token!
end