Class: Sprint
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #active? ⇒ Boolean
- #completed_at?(time) ⇒ Boolean
-
#completed_time ⇒ Object
The time that the sprint was actually closed.
-
#end_time ⇒ Object
The time that was anticipated that the sprint would close.
- #goal ⇒ Object
- #id ⇒ Object
-
#initialize(raw:, timezone_offset:) ⇒ Sprint
constructor
A new instance of Sprint.
- #name ⇒ Object
- #start_time ⇒ Object
Constructor Details
#initialize(raw:, timezone_offset:) ⇒ Sprint
Returns a new instance of Sprint.
8 9 10 11 |
# File 'lib/jirametrics/sprint.rb', line 8 def initialize raw:, timezone_offset: @raw = raw @timezone_offset = timezone_offset end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
6 7 8 |
# File 'lib/jirametrics/sprint.rb', line 6 def raw @raw end |
Instance Method Details
#active? ⇒ Boolean
14 |
# File 'lib/jirametrics/sprint.rb', line 14 def active? = (@raw['state'] == 'active') |
#completed_at?(time) ⇒ Boolean
16 17 18 19 |
# File 'lib/jirametrics/sprint.rb', line 16 def completed_at? time completed_at = completed_time completed_at && completed_at <= time end |
#completed_time ⇒ Object
The time that the sprint was actually closed
31 32 33 |
# File 'lib/jirametrics/sprint.rb', line 31 def completed_time parse_time(@raw['completeDate']) end |
#end_time ⇒ Object
The time that was anticipated that the sprint would close
26 27 28 |
# File 'lib/jirametrics/sprint.rb', line 26 def end_time parse_time(@raw['endDate']) end |
#goal ⇒ Object
35 |
# File 'lib/jirametrics/sprint.rb', line 35 def goal = @raw['goal'] |
#id ⇒ Object
13 |
# File 'lib/jirametrics/sprint.rb', line 13 def id = @raw['id'] |
#name ⇒ Object
36 |
# File 'lib/jirametrics/sprint.rb', line 36 def name = @raw['name'] |
#start_time ⇒ Object
21 22 23 |
# File 'lib/jirametrics/sprint.rb', line 21 def start_time parse_time(@raw['activatedDate'] || @raw['startDate']) end |