Class: Counter::Conditions
- Inherits:
-
Object
- Object
- Counter::Conditions
- Defined in:
- lib/counter/conditions.rb
Instance Attribute Summary collapse
-
#decrement_conditions ⇒ Object
Returns the value of attribute decrement_conditions.
-
#increment_conditions ⇒ Object
Returns the value of attribute increment_conditions.
Instance Method Summary collapse
- #decrement_if(block) ⇒ Object
- #increment_if(block) ⇒ Object
-
#initialize ⇒ Conditions
constructor
A new instance of Conditions.
Constructor Details
#initialize ⇒ Conditions
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_conditions ⇒ Object
Returns the value of attribute decrement_conditions.
2 3 4 |
# File 'lib/counter/conditions.rb', line 2 def decrement_conditions @decrement_conditions end |
#increment_conditions ⇒ Object
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 |