Class: Pickler::Tracker::Iteration
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Abstract
accessor, date_reader, #id, reader, #to_xml
Constructor Details
#initialize(project, attributes = {}) ⇒ Iteration
Returns a new instance of Iteration.
6
7
8
9
|
# File 'lib/pickler/tracker/iteration.rb', line 6
def initialize(project, attributes = {})
@project = project
super(attributes)
end
|
Instance Attribute Details
#project ⇒ Object
Returns the value of attribute project.
4
5
6
|
# File 'lib/pickler/tracker/iteration.rb', line 4
def project
@project
end
|
Instance Method Details
#finish ⇒ Object
15
16
17
|
# File 'lib/pickler/tracker/iteration.rb', line 15
def finish
Date.parse(@attributes['finish'].to_s)
end
|
#include?(date) ⇒ Boolean
28
29
30
|
# File 'lib/pickler/tracker/iteration.rb', line 28
def include?(date)
range.include?(date)
end
|
#inspect ⇒ Object
36
37
38
|
# File 'lib/pickler/tracker/iteration.rb', line 36
def inspect
"#<#{self.class.inspect}:#{number.inspect} (#{range.inspect})>"
end
|
#number ⇒ Object
Also known as:
to_i
19
20
21
|
# File 'lib/pickler/tracker/iteration.rb', line 19
def number
@attributes['number'].to_i
end
|
#range ⇒ Object
24
25
26
|
# File 'lib/pickler/tracker/iteration.rb', line 24
def range
start...finish
end
|
#start ⇒ Object
11
12
13
|
# File 'lib/pickler/tracker/iteration.rb', line 11
def start
Date.parse(@attributes['start'].to_s)
end
|
#succ ⇒ Object
32
33
34
|
# File 'lib/pickler/tracker/iteration.rb', line 32
def succ
self.class.new(project, 'number' => number.succ.to_s, 'start' => @attributes['finish'], 'finish' => (finish + (finish - start)))
end
|
#to_s ⇒ Object
40
41
42
|
# File 'lib/pickler/tracker/iteration.rb', line 40
def to_s
"#{number} (#{start}...#{finish})"
end
|