Class: Jetmeter::CloseAccumulator

Inherits:
Object
  • Object
show all
Defined in:
lib/jetmeter/close_accumulator.rb

Constant Summary collapse

CLOSED_EVENT =
'closed'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(additive: true) ⇒ CloseAccumulator

Returns a new instance of CloseAccumulator.



7
8
9
# File 'lib/jetmeter/close_accumulator.rb', line 7

def initialize(additive: true)
  @additive = additive
end

Instance Attribute Details

#additiveObject (readonly)

Returns the value of attribute additive.



5
6
7
# File 'lib/jetmeter/close_accumulator.rb', line 5

def additive
  @additive
end

Instance Method Details

#valid?(event, flow) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
# File 'lib/jetmeter/close_accumulator.rb', line 11

def valid?(event, flow)
  event.issue_event? &&
    event.event == CLOSED_EVENT &&
    closing_transition?(flow)
end