Class: Stall::CartCreditNoteCreationService
- Inherits:
-
BaseService
- Object
- BaseService
- Stall::CartCreditNoteCreationService
- Defined in:
- app/services/stall/cart_credit_note_creation_service.rb
Instance Attribute Summary collapse
-
#cart ⇒ Object
readonly
Returns the value of attribute cart.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(cart) ⇒ CartCreditNoteCreationService
constructor
A new instance of CartCreditNoteCreationService.
Constructor Details
#initialize(cart) ⇒ CartCreditNoteCreationService
Returns a new instance of CartCreditNoteCreationService.
5 6 7 |
# File 'app/services/stall/cart_credit_note_creation_service.rb', line 5 def initialize(cart) @cart = cart end |
Instance Attribute Details
#cart ⇒ Object (readonly)
Returns the value of attribute cart.
3 4 5 |
# File 'app/services/stall/cart_credit_note_creation_service.rb', line 3 def cart @cart end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'app/services/stall/cart_credit_note_creation_service.rb', line 9 def call if cart.remainder? && !adjustment_exists? credit_note = create_credit_note! create_adjustment_for!(credit_note) true else false end end |