Class: Billomat::Actions::Complete
- Inherits:
-
Object
- Object
- Billomat::Actions::Complete
- Defined in:
- lib/billomat/actions/complete.rb
Overview
Completes an invoice by calling the /complete path on a resource.
Instance Method Summary collapse
-
#call ⇒ TrueClass
Calls the gateway.
-
#initialize(invoice_id, opts = {}) ⇒ Billomat::Actions::Complete
constructor
Returns a Complete object.
-
#path ⇒ String
The complete path with the invoice_id.
-
#wrapped_data ⇒ Hash
The given options have to be wrapped.
Constructor Details
#initialize(invoice_id, opts = {}) ⇒ Billomat::Actions::Complete
Returns a Complete object.
15 16 17 18 |
# File 'lib/billomat/actions/complete.rb', line 15 def initialize(invoice_id, opts = {}) @invoice_id = invoice_id @opts = opts end |
Instance Method Details
#call ⇒ TrueClass
Calls the gateway.
23 24 25 26 27 |
# File 'lib/billomat/actions/complete.rb', line 23 def call Billomat::Gateway.new(:put, path, wrapped_data).run true end |
#path ⇒ String
Returns the complete path with the invoice_id.
37 38 39 |
# File 'lib/billomat/actions/complete.rb', line 37 def path "/invoices/#{@invoice_id}/complete" end |
#wrapped_data ⇒ Hash
The given options have to be wrapped.
32 33 34 |
# File 'lib/billomat/actions/complete.rb', line 32 def wrapped_data { complete: @opts } end |