Class: BadBill::InvoiceComment

Inherits:
BaseResource show all
Defined in:
lib/badbill/invoice_comment.rb

Overview

The InvoiceComment resource handles all invoice comments.

See www.billomat.com/en/api/invoices/comments-and-history/

Instance Attribute Summary

Attributes inherited from BaseResource

#data, #id

Class Method Summary collapse

Methods inherited from BaseResource

create, #delete, #error, find, #initialize, #save

Methods included from Resource

#call, #delete, #get, #post, #put

Methods included from ForwardMethods

#method_missing, #respond_to?

Constructor Details

This class inherits a constructor from BadBill::BaseResource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BadBill::ForwardMethods

Class Method Details

.all(invoice_id, actionkey = nil) ⇒ Array<InvoiceComment>

Get all Invoice Comments for given invoice id.

Parameters:

  • invoice_id (Integer)

    The invoice id to search for.

  • actionkey (String, Array) (defaults to: nil)

    Indicates what kind of comment it is. See API docu for possible values. An Array will be joined into a String.

Returns:


14
15
16
17
18
19
20
21
22
# File 'lib/badbill/invoice_comment.rb', line 14

def self.all invoice_id, actionkey=nil
  params = { invoice_id: invoice_id }
  if actionkey
    actionkey = actionkey.join(',') if actionkey.respond_to?(:join)
    params[:actionkey] = actionkey
  end

  super params
end