class PR::Pin::Repositories::Charges
Public Instance Methods
create(*args)
click to toggle source
# File lib/pr/pin/repositories/charges.rb, line 7 def create(*args) API::Result.wrap(root) do root.command(:create).call(*args) end end
find(token)
click to toggle source
# File lib/pr/pin/repositories/charges.rb, line 13 def find(token) relation = root.with_path(token) API::Result.wrap(relation) { relation.one } end
for_customer(customer_token, page: 1, per_page: nil)
click to toggle source
# File lib/pr/pin/repositories/charges.rb, line 36 def for_customer(customer_token, page: 1, per_page: nil) relation = root.for_customer(customer_token).with_params( page: page, per_page: per_page ) API::PaginatedResult.wrap(relation) { relation.paginate } end
list(page: 1, per_page: nil)
click to toggle source
# File lib/pr/pin/repositories/charges.rb, line 19 def list(page: 1, per_page: nil) relation = root.with_params( page: page, per_page: per_page ) API::PaginatedResult.wrap(relation) { relation.paginate } end
search(**params)
click to toggle source
# File lib/pr/pin/repositories/charges.rb, line 28 def search(**params) relation = root.append_path('search').with_params(params) API::PaginatedResult.wrap(relation) do relation.paginate end end