Class: GSGraph::Doc
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#revision ⇒ Object
Returns the value of attribute revision.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#updated_time ⇒ Object
Returns the value of attribute updated_time.
Attributes inherited from Node
#access_token, #endpoint, #identifier, #raw_attributes
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ Doc
constructor
A new instance of Doc.
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Doc
Returns a new instance of Doc.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/gs_graph/doc.rb', line 5 def initialize(identifier, attributes = {}) super @from = if attributes[:from] User.new(attributes[:from][:id], attributes[:from]) end @subject = attributes[:subject] @icon = attributes[:icon] @revision = attributes[:revision] @updated_time = if attributes[:updated_time] Time.parse(attributes[:updated_time]).utc end end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
3 4 5 |
# File 'lib/gs_graph/doc.rb', line 3 def from @from end |
#icon ⇒ Object
Returns the value of attribute icon.
3 4 5 |
# File 'lib/gs_graph/doc.rb', line 3 def icon @icon end |
#revision ⇒ Object
Returns the value of attribute revision.
3 4 5 |
# File 'lib/gs_graph/doc.rb', line 3 def revision @revision end |
#subject ⇒ Object
Returns the value of attribute subject.
3 4 5 |
# File 'lib/gs_graph/doc.rb', line 3 def subject @subject end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
3 4 5 |
# File 'lib/gs_graph/doc.rb', line 3 def updated_time @updated_time end |