Class: FbGraph::Milestone
Instance Attribute Summary collapse
-
#created_time ⇒ Object
Returns the value of attribute created_time.
-
#description ⇒ Object
Returns the value of attribute description.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#from ⇒ Object
Returns the value of attribute from.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#title ⇒ Object
Returns the value of attribute title.
-
#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 = {}) ⇒ Milestone
constructor
A new instance of Milestone.
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ Milestone
Returns a new instance of Milestone.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fb_graph/milestone.rb', line 5 def initialize(identifier, attributes = {}) super if (from = attributes[:from]) @from = Page.new from[:id], from end [:title, :description].each do |key| self.send :"#{key}=", attributes[key] end [:created_time, :updated_time, :start_time, :end_time].each do |key| if (value = attributes[key]) time = case value when String Time.parse(value) else value end self.send :"#{key}=", time end end end |
Instance Attribute Details
#created_time ⇒ Object
Returns the value of attribute created_time.
3 4 5 |
# File 'lib/fb_graph/milestone.rb', line 3 def created_time @created_time end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/fb_graph/milestone.rb', line 3 def description @description end |
#end_time ⇒ Object
Returns the value of attribute end_time.
3 4 5 |
# File 'lib/fb_graph/milestone.rb', line 3 def end_time @end_time end |
#from ⇒ Object
Returns the value of attribute from.
3 4 5 |
# File 'lib/fb_graph/milestone.rb', line 3 def from @from end |
#start_time ⇒ Object
Returns the value of attribute start_time.
3 4 5 |
# File 'lib/fb_graph/milestone.rb', line 3 def start_time @start_time end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/fb_graph/milestone.rb', line 3 def title @title end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
3 4 5 |
# File 'lib/fb_graph/milestone.rb', line 3 def updated_time @updated_time end |