Class: Jetmeter::Config::Flow

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFlow

Returns a new instance of Flow.



9
10
11
12
13
14
# File 'lib/jetmeter/config/flow.rb', line 9

def initialize
  @additions = Hash.new { |hash, key| hash[key] = [] }
  @substractions = Hash.new { |hash, key| hash[key] = [] }
  @filters = {}
  @accumulative = true
end

Instance Attribute Details

#accumulative=(value) ⇒ Object (writeonly)

Sets the attribute accumulative

Parameters:

  • value

    the value to set the attribute accumulative to.



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

def accumulative=(value)
  @accumulative = value
end

#additionsObject (readonly)

Returns the value of attribute additions.



4
5
6
# File 'lib/jetmeter/config/flow.rb', line 4

def additions
  @additions
end

#filtersObject

Returns the value of attribute filters.



6
7
8
# File 'lib/jetmeter/config/flow.rb', line 6

def filters
  @filters
end

#substractionsObject (readonly)

Returns the value of attribute substractions.



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

def substractions
  @substractions
end

Instance Method Details

#accumulative?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/jetmeter/config/flow.rb', line 32

def accumulative?
  !!@accumulative
end

#register_addition(hash) ⇒ Object



16
17
18
19
20
# File 'lib/jetmeter/config/flow.rb', line 16

def register_addition(hash)
  hash.each_pair do |key, value|
    @additions[key] << value
  end
end

#register_substraction(hash) ⇒ Object



22
23
24
25
26
# File 'lib/jetmeter/config/flow.rb', line 22

def register_substraction(hash)
  hash.each_pair do |key, value|
    @substractions[key] << value
  end
end

#transitions(additive) ⇒ Object



28
29
30
# File 'lib/jetmeter/config/flow.rb', line 28

def transitions(additive)
  additive ? additions : substractions
end