Class: Pina::Receivable
- Inherits:
-
Object
- Object
- Pina::Receivable
- Defined in:
- lib/pina/receivable.rb
Class Method Summary collapse
- .all(page = nil) ⇒ Object
- .find(id) ⇒ Object
- .new(params = nil) ⇒ Object
- .where(hash, page = nil) ⇒ Object
Class Method Details
.all(page = nil) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/pina/receivable.rb', line 29 def all(page = nil) response = Pina::RestAdapter.get(:receivables, page) return Pina::Collections::Receivable.new(attributes(response)) if response.ok? response end |
.find(id) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/pina/receivable.rb', line 11 def find(id) response = Pina::RestAdapter.get(:receivables, id) return Pina::Models::Receivable.new(attributes(response)) if response.ok? response end |
.new(params = nil) ⇒ Object
7 8 9 |
# File 'lib/pina/receivable.rb', line 7 def new(params = nil) Pina::Models::Receivable.new(params) end |
.where(hash, page = nil) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/pina/receivable.rb', line 20 def where(hash, page = nil) response = Pina::RestAdapter.get(:receivables, hash) return Pina::Collections::Receivable.new(attributes(response)) if response.ok? response end |