Class: Billomat::Actions::Cancel

Inherits:
Object
  • Object
show all
Defined in:
lib/billomat/actions/cancel.rb

Overview

This actions cancels an invoice

Instance Method Summary collapse

Constructor Details

#initialize(invoice_id) ⇒ Billomat::Actions::Cancel

Parameters:

  • invoice_id (String)

    the invoice ID



9
10
11
# File 'lib/billomat/actions/cancel.rb', line 9

def initialize(invoice_id)
  @invoice_id = invoice_id
end

Instance Method Details

#callTrueClass

Calls the gateway.

Returns:

  • (TrueClass)


16
17
18
19
20
# File 'lib/billomat/actions/cancel.rb', line 16

def call
  Billomat::Gateway.new(:put, path).run

  true
end

#pathString

Returns the cancel path with the invoice_id.

Returns:

  • (String)

    the cancel path with the invoice_id



23
24
25
# File 'lib/billomat/actions/cancel.rb', line 23

def path
  "/invoices/#{@invoice_id}/cancel"
end