lib/billomat/actions/complete.rb in billomat-0.2.0 vs lib/billomat/actions/complete.rb in billomat-0.3.0

- old
+ new

@@ -1,44 +1,40 @@ # frozen_string_literal: true module Billomat module Actions - ## - # Completes an invoice by calling the /complete path on a resource + # Completes an invoice by calling the /complete path on a resource. class Complete - ## - # Returns a Complete object + # Returns a Complete object. # - # @param [String] invoice_id The ID of the invoice - # @param [Hash] opts The options for this request + # @param invoice_id [String] the ID of the invoice + # @param opts [Hash] the options for this request # @return [Billomat::Actions::Complete] # # @example # Billomat::Actions::Complete('12345', { template_id: '10231' }) def initialize(invoice_id, opts = {}) @invoice_id = invoice_id @opts = opts end - ## - # Calls the gateway + # Calls the gateway. # # @return [TrueClass] def call Billomat::Gateway.new(:put, path, wrapped_data).run true end - ## - # The given options have to be wrapped + # The given options have to be wrapped. # - # @return [Hash] The payload for the complete request + # @return [Hash] the payload for the complete request def wrapped_data { complete: @opts } end - # @return [String] The complete path with the invoice_id + # @return [String] the complete path with the invoice_id def path "/invoices/#{@invoice_id}/complete" end end end