Class: FbGraph::Node
- Inherits:
-
Object
- Object
- FbGraph::Node
- Includes:
- Comparison
- Defined in:
- lib/fb_graph/node.rb
Direct Known Subclasses
Album, AppRequest, Application, Checkin, Comment, Doc, Domain, Event, FriendList, Group, Insight, Link, Message, Note, Order, Page, Photo, Post, Query, Review, Status, Thread, User, Video
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
Class Method Summary collapse
Instance Method Summary collapse
- #connection(connection, options = {}) ⇒ Object
- #destroy(options = {}) ⇒ Object
- #fetch(options = {}) ⇒ Object
-
#initialize(identifier, options = {}) ⇒ Node
constructor
A new instance of Node.
- #update(options = {}) ⇒ Object
Methods included from Comparison
Constructor Details
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
5 6 7 |
# File 'lib/fb_graph/node.rb', line 5 def access_token @access_token end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
5 6 7 |
# File 'lib/fb_graph/node.rb', line 5 def endpoint @endpoint end |
#identifier ⇒ Object
Returns the value of attribute identifier.
5 6 7 |
# File 'lib/fb_graph/node.rb', line 5 def identifier @identifier end |
Class Method Details
.fetch(identifier, options = {}) ⇒ Object
19 20 21 |
# File 'lib/fb_graph/node.rb', line 19 def self.fetch(identifier, = {}) new(identifier).fetch() end |
Instance Method Details
#connection(connection, options = {}) ⇒ Object
23 24 25 26 |
# File 'lib/fb_graph/node.rb', line 23 def connection(connection, = {}) collection = [:cached_collection] || Collection.new(get(.merge(:connection => connection))) Connection.new(self, connection, .merge(:collection => collection)) end |
#destroy(options = {}) ⇒ Object
32 33 34 |
# File 'lib/fb_graph/node.rb', line 32 def destroy( = {}) delete() end |
#fetch(options = {}) ⇒ Object
13 14 15 16 17 |
# File 'lib/fb_graph/node.rb', line 13 def fetch( = {}) [:access_token] ||= self.access_token if self.access_token _fetched_ = get() self.class.new(_fetched_[:id], _fetched_.merge(:access_token => [:access_token])) end |
#update(options = {}) ⇒ Object
28 29 30 |
# File 'lib/fb_graph/node.rb', line 28 def update( = {}) post() end |