Class: TerminalShop::Resources::Product
- Inherits:
-
Object
- Object
- TerminalShop::Resources::Product
- Defined in:
- lib/terminal_shop/resources/product.rb
Instance Method Summary collapse
-
#get(id, request_options: {}) ⇒ TerminalShop::Models::ProductGetResponse
Get a product by ID from the Terminal shop.
-
#initialize(client:) ⇒ Product
constructor
private
A new instance of Product.
-
#list(request_options: {}) ⇒ TerminalShop::Models::ProductListResponse
List all products for sale in the Terminal shop.
Constructor Details
#initialize(client:) ⇒ Product
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Product.
47 48 49 |
# File 'lib/terminal_shop/resources/product.rb', line 47 def initialize(client:) @client = client end |
Instance Method Details
#get(id, request_options: {}) ⇒ TerminalShop::Models::ProductGetResponse
Get a product by ID from the Terminal shop.
35 36 37 38 39 40 41 42 |
# File 'lib/terminal_shop/resources/product.rb', line 35 def get(id, params = {}) @client.request( method: :get, path: ["product/%1$s", id], model: TerminalShop::Models::ProductGetResponse, options: params[:request_options] ) end |
#list(request_options: {}) ⇒ TerminalShop::Models::ProductListResponse
List all products for sale in the Terminal shop.
15 16 17 18 19 20 21 22 |
# File 'lib/terminal_shop/resources/product.rb', line 15 def list(params = {}) @client.request( method: :get, path: "product", model: TerminalShop::Models::ProductListResponse, options: params[:request_options] ) end |