Class: ZohoInvoice::Collection
- Inherits:
-
Object
- Object
- ZohoInvoice::Collection
- Defined in:
- lib/zoho_invoice/collection.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #create(*args, &block) ⇒ Object
-
#initialize(resource, client) ⇒ Collection
constructor
A new instance of Collection.
- #new(*args, &block) ⇒ Object
- #search(*args, &block) ⇒ Object
Constructor Details
#initialize(resource, client) ⇒ Collection
Returns a new instance of Collection.
6 7 8 9 10 |
# File 'lib/zoho_invoice/collection.rb', line 6 def initialize(resource, client) @resource = resource @klass = "ZohoInvoice::#{resource[0..-2].capitalize}".split('::').reduce(Module, :const_get) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'lib/zoho_invoice/collection.rb', line 4 def client @client end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
4 5 6 |
# File 'lib/zoho_invoice/collection.rb', line 4 def klass @klass end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
4 5 6 |
# File 'lib/zoho_invoice/collection.rb', line 4 def resource @resource end |
Instance Method Details
#create(*args, &block) ⇒ Object
20 21 22 |
# File 'lib/zoho_invoice/collection.rb', line 20 def create(*args, &block) @klass.create(@client, *args, &block) end |
#new(*args, &block) ⇒ Object
16 17 18 |
# File 'lib/zoho_invoice/collection.rb', line 16 def new(*args, &block) @klass.new(@client, *args, &block) end |
#search(*args, &block) ⇒ Object
12 13 14 |
# File 'lib/zoho_invoice/collection.rb', line 12 def search(*args, &block) @klass.search(@client, *args, &block) end |