Class: Sprint
- Inherits:
-
Object
- Object
- Sprint
- Defined in:
- lib/jirametrics/sprint.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #active? ⇒ Boolean
- #closed? ⇒ 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') |
#closed? ⇒ Boolean
15 |
# File 'lib/jirametrics/sprint.rb', line 15 def closed? = (@raw['state'] == 'closed') |
#completed_at?(time) ⇒ Boolean
17 18 19 20 |
# File 'lib/jirametrics/sprint.rb', line 17 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
32 33 34 |
# File 'lib/jirametrics/sprint.rb', line 32 def completed_time parse_time(@raw['completeDate']) end |
#end_time ⇒ Object
The time that was anticipated that the sprint would close
27 28 29 |
# File 'lib/jirametrics/sprint.rb', line 27 def end_time parse_time(@raw['endDate']) end |
#goal ⇒ Object
36 |
# File 'lib/jirametrics/sprint.rb', line 36 def goal = @raw['goal'] |
#id ⇒ Object
13 |
# File 'lib/jirametrics/sprint.rb', line 13 def id = @raw['id'] |
#name ⇒ Object
37 |
# File 'lib/jirametrics/sprint.rb', line 37 def name = @raw['name'] |
#start_time ⇒ Object
22 23 24 |
# File 'lib/jirametrics/sprint.rb', line 22 def start_time parse_time(@raw['activatedDate'] || @raw['startDate']) end |