Class: PR::Pin::Repositories::Customers
- Inherits:
-
Object
- Object
- PR::Pin::Repositories::Customers
- Defined in:
- lib/pr/pin/repositories/customers.rb
Instance Method Summary collapse
- #create(*args) ⇒ Object
- #find(token) ⇒ Object
- #list(page: 1, per_page: nil) ⇒ Object
- #update(token, *args) ⇒ Object
Instance Method Details
#create(*args) ⇒ Object
7 8 9 10 11 |
# File 'lib/pr/pin/repositories/customers.rb', line 7 def create(*args) API::Result.wrap(root) do root.command(:create).call(*args) end end |
#find(token) ⇒ Object
19 20 21 22 23 |
# File 'lib/pr/pin/repositories/customers.rb', line 19 def find(token) relation = root.with_path(token) API::Result.wrap(relation) { relation.one } end |
#list(page: 1, per_page: nil) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/pr/pin/repositories/customers.rb', line 25 def list(page: 1, per_page: nil) relation = root.with_params( page: page, per_page: per_page ) API::PaginatedResult.wrap(relation) { relation.paginate } end |