Class: ReimbursementShipping
- Inherits:
-
Object
- Object
- ReimbursementShipping
- Includes:
- Spree::ReimbursementType::ReimbursementHelpers
- Defined in:
- app/models/reimbursement_shipping.rb
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#reimbursement ⇒ Object
Returns the value of attribute reimbursement.
Instance Method Summary collapse
-
#initialize(reimbursement) ⇒ ReimbursementShipping
constructor
A new instance of ReimbursementShipping.
- #update!(shipping_amount) ⇒ Object
Constructor Details
#initialize(reimbursement) ⇒ ReimbursementShipping
Returns a new instance of ReimbursementShipping.
7 8 9 10 |
# File 'app/models/reimbursement_shipping.rb', line 7 def initialize(reimbursement) @order = reimbursement.order @reimbursement = reimbursement end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
3 4 5 |
# File 'app/models/reimbursement_shipping.rb', line 3 def order @order end |
#reimbursement ⇒ Object
Returns the value of attribute reimbursement.
2 3 4 |
# File 'app/models/reimbursement_shipping.rb', line 2 def reimbursement @reimbursement end |
Instance Method Details
#update!(shipping_amount) ⇒ Object
12 13 14 15 |
# File 'app/models/reimbursement_shipping.rb', line 12 def update!(shipping_amount) reimbursement.update!(total: calculated_amount(shipping_amount)) create_refund_payment!(shipping_amount) end |