Class: GSGraph::Milestone

Inherits:
Node
  • Object
show all
Defined in:
lib/gs_graph/milestone.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#access_token, #endpoint, #identifier, #raw_attributes

Instance Method Summary collapse

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/gs_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_timeObject

Returns the value of attribute created_time.



3
4
5
# File 'lib/gs_graph/milestone.rb', line 3

def created_time
  @created_time
end

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/gs_graph/milestone.rb', line 3

def description
  @description
end

#end_timeObject

Returns the value of attribute end_time.



3
4
5
# File 'lib/gs_graph/milestone.rb', line 3

def end_time
  @end_time
end

#fromObject

Returns the value of attribute from.



3
4
5
# File 'lib/gs_graph/milestone.rb', line 3

def from
  @from
end

#start_timeObject

Returns the value of attribute start_time.



3
4
5
# File 'lib/gs_graph/milestone.rb', line 3

def start_time
  @start_time
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/gs_graph/milestone.rb', line 3

def title
  @title
end

#updated_timeObject

Returns the value of attribute updated_time.



3
4
5
# File 'lib/gs_graph/milestone.rb', line 3

def updated_time
  @updated_time
end