Class: KanbanMetrics::WorkItem

Inherits:
Object
  • Object
show all
Defined in:
lib/kanban_metrics/work_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_countObject

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

#committedObject

Returns the value of attribute committed.



5
6
7
# File 'lib/kanban_metrics/work_item.rb', line 5

def committed
  @committed
end

#deliveredObject

Returns the value of attribute delivered.



5
6
7
# File 'lib/kanban_metrics/work_item.rb', line 5

def delivered
  @delivered
end

#estimated_timeObject

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

#finishedObject

Returns the value of attribute finished.



5
6
7
# File 'lib/kanban_metrics/work_item.rb', line 5

def finished
  @finished
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/kanban_metrics/work_item.rb', line 5

def id
  @id
end

#spent_timeObject

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

#startedObject

Returns the value of attribute started.



5
6
7
# File 'lib/kanban_metrics/work_item.rb', line 5

def started
  @started
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/kanban_metrics/work_item.rb', line 5

def type
  @type
end