Class: StrategyBag::Strategy
- Inherits:
-
Object
- Object
- StrategyBag::Strategy
- Defined in:
- lib/strategy_bag.rb
Instance Attribute Summary collapse
-
#action(&block) ⇒ Object
Returns the value of attribute action.
-
#conditions ⇒ Object
Returns the value of attribute conditions.
Instance Method Summary collapse
- #condition(name) ⇒ Object
-
#initialize ⇒ Strategy
constructor
A new instance of Strategy.
Constructor Details
#initialize ⇒ Strategy
Returns a new instance of Strategy.
110 111 112 |
# File 'lib/strategy_bag.rb', line 110 def initialize @conditions = [] end |
Instance Attribute Details
#action(&block) ⇒ Object
Returns the value of attribute action.
108 109 110 |
# File 'lib/strategy_bag.rb', line 108 def action @action end |
#conditions ⇒ Object
Returns the value of attribute conditions.
108 109 110 |
# File 'lib/strategy_bag.rb', line 108 def conditions @conditions end |
Instance Method Details
#condition(name) ⇒ Object
114 115 116 |
# File 'lib/strategy_bag.rb', line 114 def condition(name) @conditions << name end |