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
17 18 19 20 |
# File 'lib/billomat/actions/complete.rb', line 17 def initialize(invoice_id, opts = {}) @invoice_id = invoice_id @opts = opts end |
Instance Method Details
#call ⇒ TrueClass
Calls the gateway
26 27 28 29 30 |
# File 'lib/billomat/actions/complete.rb', line 26 def call Billomat::Gateway.new(:put, path, wrapped_data).run true end |
#path ⇒ String
Returns The complete path with the invoice_id.
41 42 43 |
# File 'lib/billomat/actions/complete.rb', line 41 def path "/invoices/#{@invoice_id}/complete" end |
#wrapped_data ⇒ Hash
The given options have to be wrapped
36 37 38 |
# File 'lib/billomat/actions/complete.rb', line 36 def wrapped_data { complete: @opts } end |