Class: FeeCalculator
- Inherits:
-
Object
- Object
- FeeCalculator
- Defined in:
- app/models/fee_calculator.rb
Instance Attribute Summary collapse
-
#fee_strategy ⇒ Object
Returns the value of attribute fee_strategy.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#fee_strategy ⇒ Object
Returns the value of attribute fee_strategy.
2 3 4 |
# File 'app/models/fee_calculator.rb', line 2 def fee_strategy @fee_strategy end |
Class Method Details
.apply(fee_strategy) ⇒ Object
4 5 6 7 8 |
# File 'app/models/fee_calculator.rb', line 4 def self.apply(fee_strategy) fc = FeeCalculator.new fc.fee_strategy = fee_strategy fc end |
Instance Method Details
#to(cart) ⇒ Object
10 11 12 |
# File 'app/models/fee_calculator.rb', line 10 def to(cart) self.fee_strategy.apply_to_cart(cart) end |