Class: Counter::Conditions

Inherits:
Object
  • Object
show all
Defined in:
lib/counter/conditions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConditions

Returns a new instance of Conditions.



4
5
6
7
# File 'lib/counter/conditions.rb', line 4

def initialize
  @increment_conditions = []
  @decrement_conditions = []
end

Instance Attribute Details

#decrement_conditionsObject

Returns the value of attribute decrement_conditions.



2
3
4
# File 'lib/counter/conditions.rb', line 2

def decrement_conditions
  @decrement_conditions
end

#increment_conditionsObject

Returns the value of attribute increment_conditions.



2
3
4
# File 'lib/counter/conditions.rb', line 2

def increment_conditions
  @increment_conditions
end

Instance Method Details

#decrement_if(block) ⇒ Object



13
14
15
# File 'lib/counter/conditions.rb', line 13

def decrement_if block
  decrement_conditions << block
end

#increment_if(block) ⇒ Object



9
10
11
# File 'lib/counter/conditions.rb', line 9

def increment_if block
  increment_conditions << block
end