Class: GSGraph::TaggedObject
Instance Attribute Summary collapse
-
#length ⇒ Object
Returns the value of attribute length.
-
#name ⇒ Object
Returns the value of attribute name.
-
#offset ⇒ Object
Returns the value of attribute offset.
Attributes inherited from Node
#access_token, #endpoint, #identifier, #raw_attributes
Instance Method Summary collapse
- #fetch_with_class_determination ⇒ Object
-
#initialize(identifier, attributes = {}) ⇒ TaggedObject
constructor
A new instance of TaggedObject.
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ TaggedObject
Returns a new instance of TaggedObject.
5 6 7 8 9 10 |
# File 'lib/gs_graph/tagged_object.rb', line 5 def initialize(identifier, attributes = {}) super [:name, :offset, :length].each do |key| self.send("#{key}=", attributes[key]) end end |
Instance Attribute Details
#length ⇒ Object
Returns the value of attribute length.
3 4 5 |
# File 'lib/gs_graph/tagged_object.rb', line 3 def length @length end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/gs_graph/tagged_object.rb', line 3 def name @name end |
#offset ⇒ Object
Returns the value of attribute offset.
3 4 5 |
# File 'lib/gs_graph/tagged_object.rb', line 3 def offset @offset end |
Instance Method Details
#fetch_with_class_determination ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/gs_graph/tagged_object.rb', line 12 def fetch_with_class_determination attributes = fetch_without_class_determination.raw_attributes klass = if attributes[:category] Page else User end klass.new attributes[:id], attributes end |