Sha256: 8ec659f27097fc9053bc27d56bcbe18526839bd8018aa384c16a007cdd93af21
Contents?: true
Size: 766 Bytes
Versions: 9
Compression:
Stored size: 766 Bytes
Contents
module Paddle class Product < Object class << self def list(**params) response = Client.get_request("products", params: params) Collection.from_response(response, type: Product) end def create(name:, tax_category:, **params) attrs = { name: name, tax_category: tax_category } response = Client.post_request("products", body: attrs.merge(params)) Product.new(response.body["data"]) end def retrieve(id:) response = Client.get_request("products/#{id}") Product.new(response.body["data"]) end def update(id:, **params) response = Client.patch_request("products/#{id}", body: params) Product.new(response.body["data"]) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems