Class: Returnly::Refund::AmountCalculator
- Inherits:
-
Object
- Object
- Returnly::Refund::AmountCalculator
- Defined in:
- lib/returnly/refund/amount_calculator.rb
Instance Attribute Summary collapse
-
#refund ⇒ Object
Returns the value of attribute refund.
Instance Method Summary collapse
-
#initialize(refund) ⇒ AmountCalculator
constructor
A new instance of AmountCalculator.
- #return_item_refund_amount(return_item) ⇒ Object
Constructor Details
#initialize(refund) ⇒ AmountCalculator
Returns a new instance of AmountCalculator.
6 7 8 |
# File 'lib/returnly/refund/amount_calculator.rb', line 6 def initialize(refund) self.refund = refund end |
Instance Attribute Details
#refund ⇒ Object
Returns the value of attribute refund.
4 5 6 |
# File 'lib/returnly/refund/amount_calculator.rb', line 4 def refund @refund end |
Instance Method Details
#return_item_refund_amount(return_item) ⇒ Object
10 11 12 |
# File 'lib/returnly/refund/amount_calculator.rb', line 10 def return_item_refund_amount(return_item) (item_price(return_item) * item_price_percentage / 100).round(2, :down) end |