Class: FbGraph::Application
- Includes:
- Connections::Albums, Connections::Events, Connections::Feed, Connections::Insights, Connections::Links, Connections::Notes, Connections::Photos, Connections::Picture, Connections::Posts, Connections::Statuses, Connections::Subscriptions, Connections::Tagged, Connections::TestUsers, Connections::Videos
- Defined in:
- lib/fb_graph/application.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#description ⇒ Object
Returns the value of attribute description.
-
#link ⇒ Object
Returns the value of attribute link.
-
#name ⇒ Object
Returns the value of attribute name.
-
#secret ⇒ Object
Returns the value of attribute secret.
Attributes inherited from Node
#access_token, #endpoint, #identifier
Instance Method Summary collapse
- #get_access_token(secret = nil) ⇒ Object
-
#initialize(client_id, attributes = {}) ⇒ Application
constructor
A new instance of Application.
Methods included from Connections::Videos
Methods included from Connections::TestUsers
Methods included from Connections::Tagged
Methods included from Connections::Subscriptions
#subscribe!, #subscriptions, #unsubscribe!
Methods included from Connections::Statuses
Methods included from Connections::Posts
Methods included from Connections::Picture
Methods included from Connections::Photos
Methods included from Connections::Notes
Methods included from Connections::Links
Methods included from Connections::Insights
Methods included from Connections::Feed
Methods included from Connections::Events
Methods included from Connections::Albums
Methods inherited from Node
#connection, #destroy, fetch, #fetch
Methods included from Comparison
Constructor Details
#initialize(client_id, attributes = {}) ⇒ Application
20 21 22 23 24 25 26 27 |
# File 'lib/fb_graph/application.rb', line 20 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
#category ⇒ Object
Returns the value of attribute category.
18 19 20 |
# File 'lib/fb_graph/application.rb', line 18 def category @category end |
#description ⇒ Object
Returns the value of attribute description.
18 19 20 |
# File 'lib/fb_graph/application.rb', line 18 def description @description end |
#link ⇒ Object
Returns the value of attribute link.
18 19 20 |
# File 'lib/fb_graph/application.rb', line 18 def link @link end |
#name ⇒ Object
Returns the value of attribute name.
18 19 20 |
# File 'lib/fb_graph/application.rb', line 18 def name @name end |
#secret ⇒ Object
Returns the value of attribute secret.
18 19 20 |
# File 'lib/fb_graph/application.rb', line 18 def secret @secret end |
Instance Method Details
#get_access_token(secret = nil) ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/fb_graph/application.rb', line 29 def get_access_token(secret = nil) self.secret ||= secret auth = Auth.new(self.identifier, self.secret) response_string = auth.client.request(:post, auth.client.access_token_url, { :client_id => self.identifier, :client_secret => self.secret, :type => 'client_cred' }) self.access_token = response_string.split('=').last end |