Class: Gantty::Task
- Inherits:
-
Object
- Object
- Gantty::Task
- Defined in:
- lib/gantty.rb
Instance Attribute Summary collapse
-
#coordinators ⇒ Object
Returns the value of attribute coordinators.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#end ⇒ Object
Returns the value of attribute end.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#percent_complete ⇒ Object
Returns the value of attribute percent_complete.
-
#start ⇒ Object
Returns the value of attribute start.
Instance Method Summary collapse
-
#initialize(t) ⇒ Task
constructor
A new instance of Task.
Constructor Details
#initialize(t) ⇒ Task
Returns a new instance of Task.
41 42 43 44 45 46 47 48 49 |
# File 'lib/gantty.rb', line 41 def initialize t @name = t.attributes["name"] @start = Date.strptime(t.attributes["start"]) @duration = t.attributes["duration"].to_i @end = @start + @duration @percent_complete = t.attributes["complete"] @coordinators = [] @id = t.attributes["id"].to_i end |
Instance Attribute Details
#coordinators ⇒ Object
Returns the value of attribute coordinators.
38 39 40 |
# File 'lib/gantty.rb', line 38 def coordinators @coordinators end |
#duration ⇒ Object
Returns the value of attribute duration.
38 39 40 |
# File 'lib/gantty.rb', line 38 def duration @duration end |
#end ⇒ Object
Returns the value of attribute end.
38 39 40 |
# File 'lib/gantty.rb', line 38 def end @end end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
39 40 41 |
# File 'lib/gantty.rb', line 39 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
38 39 40 |
# File 'lib/gantty.rb', line 38 def name @name end |
#percent_complete ⇒ Object
Returns the value of attribute percent_complete.
38 39 40 |
# File 'lib/gantty.rb', line 38 def percent_complete @percent_complete end |
#start ⇒ Object
Returns the value of attribute start.
38 39 40 |
# File 'lib/gantty.rb', line 38 def start @start end |