Class: Textmagic::REST::Invoices

Inherits:
ListResource show all
Defined in:
lib/textmagic-ruby/rest/invoices.rb

Instance Method Summary collapse

Methods inherited from ListResource

#initialize, #inspect

Methods included from Utils

#key_map, #resource, #to_camel_case, #to_underscore_case

Constructor Details

This class inherits a constructor from Textmagic::REST::ListResource

Instance Method Details

#create(params = {}) ⇒ Object

Creating is not supported.



28
29
30
# File 'lib/textmagic-ruby/rest/invoices.rb', line 28

def create(params={})
  raise '`create` method is not supported for this resource.'
end

#delete(uid) ⇒ Object

Deleting is not supported.



49
50
51
# File 'lib/textmagic-ruby/rest/invoices.rb', line 49

def delete(uid)
  raise '`delete` method is not supported for this resource.'
end

#get(uid) ⇒ Object

Getting is not supported.



35
36
37
# File 'lib/textmagic-ruby/rest/invoices.rb', line 35

def get(uid)
  raise '`get` method by ID is not supported for this resource.'
end

#list(params = {}) ⇒ Object

Get all user invoices. Returns PaginateResource object, contains array of Invoices objects.

The following params keys are supported:

page

Fetch specified results page. Defaults 1

limit

How many results on page. Defaults 10

Example:

@invoices = client.invoices.list


18
19
20
21
22
23
# File 'lib/textmagic-ruby/rest/invoices.rb', line 18

def list(params={})
  [:search, 'search'].each do |search|
    params.delete search
  end
  super params
end

#update(uid, params = {}) ⇒ Object

Updating is not supported.



42
43
44
# File 'lib/textmagic-ruby/rest/invoices.rb', line 42

def update(uid, params={})
  raise '`update` method is not supported for this resource.'
end