Class: KanbanMetrics::WorkItem
- Inherits:
-
Object
- Object
- KanbanMetrics::WorkItem
- Defined in:
- lib/kanban_metrics/work_item.rb
Instance Attribute Summary collapse
-
#back_count ⇒ Object
Returns the value of attribute back_count.
-
#committed ⇒ Object
Returns the value of attribute committed.
-
#delivered ⇒ Object
Returns the value of attribute delivered.
-
#estimated_time ⇒ Object
Returns the value of attribute estimated_time.
-
#finished ⇒ Object
Returns the value of attribute finished.
-
#id ⇒ Object
Returns the value of attribute id.
-
#spent_time ⇒ Object
Returns the value of attribute spent_time.
-
#started ⇒ Object
Returns the value of attribute started.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(map) ⇒ WorkItem
constructor
A new instance of WorkItem.
Constructor Details
#initialize(map) ⇒ WorkItem
Returns a new instance of WorkItem.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/kanban_metrics/work_item.rb', line 7 def initialize(map) map.each do |key, value| eval("@#{key}=\"#{value}\"") # this didn't work: eval("@#{key}=\"#{Date.parse(value)}\"") if key == :committed && @committed @committed = Date.parse(@committed) elsif key == :started && @started @started = Date.parse(@started) elsif key == :finished && @finished @finished = Date.parse(@finished) elsif key == :delivered && @delivered @delivered = Date.parse(@delivered) end end end |
Instance Attribute Details
#back_count ⇒ Object
Returns the value of attribute back_count.
5 6 7 |
# File 'lib/kanban_metrics/work_item.rb', line 5 def back_count @back_count end |
#committed ⇒ Object
Returns the value of attribute committed.
5 6 7 |
# File 'lib/kanban_metrics/work_item.rb', line 5 def committed @committed end |
#delivered ⇒ Object
Returns the value of attribute delivered.
5 6 7 |
# File 'lib/kanban_metrics/work_item.rb', line 5 def delivered @delivered end |
#estimated_time ⇒ Object
Returns the value of attribute estimated_time.
5 6 7 |
# File 'lib/kanban_metrics/work_item.rb', line 5 def estimated_time @estimated_time end |
#finished ⇒ Object
Returns the value of attribute finished.
5 6 7 |
# File 'lib/kanban_metrics/work_item.rb', line 5 def finished @finished end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/kanban_metrics/work_item.rb', line 5 def id @id end |
#spent_time ⇒ Object
Returns the value of attribute spent_time.
5 6 7 |
# File 'lib/kanban_metrics/work_item.rb', line 5 def spent_time @spent_time end |
#started ⇒ Object
Returns the value of attribute started.
5 6 7 |
# File 'lib/kanban_metrics/work_item.rb', line 5 def started @started end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/kanban_metrics/work_item.rb', line 5 def type @type end |