Class: Billomat::Actions::Pdf
- Inherits:
-
Object
- Object
- Billomat::Actions::Pdf
- Defined in:
- lib/billomat/actions/pdf.rb
Overview
This class allows to download the invoice as a pdf. The PDF comes in a base64 encoded string in the response body.
Instance Method Summary collapse
-
#call ⇒ TrueClass
Calls the gateway.
- #initialize(invoice_id, opts = {}) ⇒ Billomat::Actions::Pdf constructor
-
#path ⇒ Hash
Wraps the options.
Constructor Details
#initialize(invoice_id, opts = {}) ⇒ Billomat::Actions::Pdf
13 14 15 16 |
# File 'lib/billomat/actions/pdf.rb', line 13 def initialize(invoice_id, opts = {}) @invoice_id = invoice_id @opts = opts end |
Instance Method Details
#call ⇒ TrueClass
Calls the gateway
22 23 24 25 |
# File 'lib/billomat/actions/pdf.rb', line 22 def call resp = Billomat::Gateway.new(:get, path).run resp['pdf'] end |
#path ⇒ Hash
Wraps the options
31 32 33 |
# File 'lib/billomat/actions/pdf.rb', line 31 def path "/invoices/#{@invoice_id}/pdf" end |