Class: FbGraph::Node
- Inherits:
-
Object
- Object
- FbGraph::Node
- Includes:
- Comparison
- Defined in:
- lib/fb_graph/node.rb
Direct Known Subclasses
Achievement, AdAccount, AdCampaign, AdCampaignStat, AdConnectionObject, AdCreative, AdGroup, AdGroupStat, AdKeyword, AdKeywordValid, AdPreview, Album, AppRequest, Application, BroadTargetingCategory, Checkin, Comment, Doc, Domain, Event, FriendList, Group, Insight, Link, Message, Milestone, Note, Notification, Offer, OpenGraph::Action, OpenGraph::Object, Order, Page, Photo, Post, Query, Question, QuestionOption, ReachEstimate, Score, Status, Tab, TaggedObject, Thread, Thread::BeforeTransition, User, UserAchievement, Video, Rack::OAuth2::AccessToken::Introspectable::Result
Instance Attribute Summary (collapse)
-
- (Object) access_token
Returns the value of attribute access_token.
-
- (Object) endpoint
Returns the value of attribute endpoint.
-
- (Object) identifier
Returns the value of attribute identifier.
-
- (Object) raw_attributes
Returns the value of attribute raw_attributes.
Class Method Summary (collapse)
Instance Method Summary (collapse)
- - (Object) connection(connection, options = {})
- - (Object) destroy(options = {})
- - (Object) fetch(options = {})
-
- (Node) initialize(identifier, attributes = {})
constructor
A new instance of Node.
- - (Object) update(options = {})
Methods included from Comparison
Constructor Details
- (Node) initialize(identifier, attributes = {})
A new instance of Node
9 10 11 12 13 14 15 |
# File 'lib/fb_graph/node.rb', line 9 def initialize(identifier, attributes = {}) @identifier = identifier @endpoint = File.join(ROOT_URL, identifier.to_s) @access_token = attributes[:access_token] @raw_attributes = attributes @cached_collections = {} end |
Instance Attribute Details
- (Object) access_token
Returns the value of attribute access_token
7 8 9 |
# File 'lib/fb_graph/node.rb', line 7 def access_token @access_token end |
- (Object) endpoint
Returns the value of attribute endpoint
7 8 9 |
# File 'lib/fb_graph/node.rb', line 7 def endpoint @endpoint end |
- (Object) identifier
Returns the value of attribute identifier
7 8 9 |
# File 'lib/fb_graph/node.rb', line 7 def identifier @identifier end |
- (Object) raw_attributes
Returns the value of attribute raw_attributes
7 8 9 |
# File 'lib/fb_graph/node.rb', line 7 def raw_attributes @raw_attributes end |
Class Method Details
+ (Object) fetch(identifier, options = {})
24 25 26 |
# File 'lib/fb_graph/node.rb', line 24 def self.fetch(identifier, = {}) new(identifier).fetch() end |
Instance Method Details
- (Object) connection(connection, options = {})
28 29 30 31 32 33 34 35 36 |
# File 'lib/fb_graph/node.rb', line 28 def connection(connection, = {}) Connection.new( self, connection, .merge( :collection => collection_for(connection, ) ) ) end |
- (Object) destroy(options = {})
42 43 44 |
# File 'lib/fb_graph/node.rb', line 42 def destroy( = {}) delete end |
- (Object) fetch(options = {})
17 18 19 20 21 22 |
# File 'lib/fb_graph/node.rb', line 17 def fetch( = {}) [:access_token] ||= self.access_token if self.access_token _fetched_ = get _fetched_[:access_token] ||= [:access_token] self.class.new(_fetched_[:id], _fetched_) end |
- (Object) update(options = {})
38 39 40 |
# File 'lib/fb_graph/node.rb', line 38 def update( = {}) post end |