Class: Wegift::Stock
Constant Summary collapse
- PATH =
'/stock'
Constants inherited from Response
Instance Attribute Summary collapse
-
#available_stock ⇒ Object
response/success.
-
#currency_code ⇒ Object
response/success.
-
#id ⇒ Object
readonly
request/payload.
-
#product_code ⇒ Object
response/success.
-
#product_name ⇒ Object
response/success.
Attributes inherited from Response
#error_code, #error_details, #error_string, #payload, #status
Instance Method Summary collapse
-
#get(ctx) ⇒ Object
Product Stock GET /api/b2b-sync/v1/stock/ID.
-
#initialize(params = {}) ⇒ Stock
constructor
A new instance of Stock.
Methods inherited from Response
Constructor Details
#initialize(params = {}) ⇒ Stock
Returns a new instance of Stock.
12 13 14 |
# File 'lib/wegift/models/stock.rb', line 12 def initialize(params = {}) @id = params[:id] end |
Instance Attribute Details
#available_stock ⇒ Object
response/success
10 11 12 |
# File 'lib/wegift/models/stock.rb', line 10 def available_stock @available_stock end |
#currency_code ⇒ Object
response/success
10 11 12 |
# File 'lib/wegift/models/stock.rb', line 10 def currency_code @currency_code end |
#id ⇒ Object (readonly)
request/payload
7 8 9 |
# File 'lib/wegift/models/stock.rb', line 7 def id @id end |
#product_code ⇒ Object
response/success
10 11 12 |
# File 'lib/wegift/models/stock.rb', line 10 def product_code @product_code end |
#product_name ⇒ Object
response/success
10 11 12 |
# File 'lib/wegift/models/stock.rb', line 10 def product_name @product_name end |
Instance Method Details
#get(ctx) ⇒ Object
Product Stock GET /api/b2b-sync/v1/stock/ID
18 19 20 21 22 23 |
# File 'lib/wegift/models/stock.rb', line 18 def get(ctx) response = ctx.request(:get, path) parse(response) self end |