Class: Sprint

Inherits:
Object show all
Defined in:
lib/jirametrics/sprint.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rawObject (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

Returns:

  • (Boolean)


14
# File 'lib/jirametrics/sprint.rb', line 14

def active? = (@raw['state'] == 'active')

#completed_at?(time) ⇒ Boolean

Returns:

  • (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_timeObject

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_timeObject

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

#goalObject



35
# File 'lib/jirametrics/sprint.rb', line 35

def goal = @raw['goal']

#idObject



13
# File 'lib/jirametrics/sprint.rb', line 13

def id = @raw['id']

#nameObject



36
# File 'lib/jirametrics/sprint.rb', line 36

def name = @raw['name']

#start_timeObject



21
22
23
# File 'lib/jirametrics/sprint.rb', line 21

def start_time
  parse_time(@raw['activatedDate'] || @raw['startDate'])
end