Sha256: 987f19aac4116a04203a0ae3562571495cfded4261813fc98f9084d24dfe82f0

Contents?: true

Size: 600 Bytes

Versions: 7

Compression:

Stored size: 600 Bytes

Contents

# frozen_string_literal: true

module Billomat
  module Actions
    ##
    # This actions cancels an invoice
    class Cancel
      # @param [String] invoice_id The invoice ID
      # @return [Billomat::Actions::Cancel]
      def initialize(invoice_id)
        @invoice_id = invoice_id
      end

      ##
      # Calls the gateway
      #
      # @return [TrueClass]
      def call
        Billomat::Gateway.new(:put, path).run

        true
      end

      # @return [String] The cancel path with the invoice_id
      def path
        "/invoices/#{@invoice_id}/cancel"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
billomat-0.2.0 lib/billomat/actions/cancel.rb
billomat-0.1.6 lib/billomat/actions/cancel.rb
billomat-0.1.5 lib/billomat/actions/cancel.rb
billomat-0.1.4 lib/billomat/actions/cancel.rb
billomat-0.1.3 lib/billomat/actions/cancel.rb
billomat-0.1.2 lib/billomat/actions/cancel.rb
billomat-0.1.1 lib/billomat/actions/cancel.rb