Module: Skus
- Included in:
- Ecommerce
- Defined in:
- lib/user/ecommerce/skus.rb
Instance Method Summary collapse
-
#create_sku(data) ⇒ Object
Create sku.
-
#delete_sku(id) ⇒ Object
Delete sku.
-
#get_sku(id, options = nil) ⇒ Object
Get sku.
-
#get_skus(options = nil) ⇒ Object
Get skus.
-
#update_sku(id, data) ⇒ Object
Update sku.
Instance Method Details
permalink #create_sku(data) ⇒ Object
Create sku.
Create a sku with data.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"sku": "NEW-SKU-XXXXXX",
"title": "New Sku",
"slug": "new-sku",
"product_id": 1
}
@data = @mints_user.create_sku(data)
57 58 59 |
# File 'lib/user/ecommerce/skus.rb', line 57 def create_sku(data) return @client.raw("post", "/ecommerce/skus", nil, data_transform(data)) end |
permalink #delete_sku(id) ⇒ Object
Delete sku.
Delete a sku.
Parameters
- id
-
(Integer) – Sku id.
Example
@data = @mints_user.delete_sku(531)
85 86 87 |
# File 'lib/user/ecommerce/skus.rb', line 85 def delete_sku(id) return @client.raw("delete", "/ecommerce/skus/#{id}") end |
permalink #get_sku(id, options = nil) ⇒ Object
Get sku.
Get a sku info.
Parameters
- id
-
(Integer) – Sku id.
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_user.get_sku(1)
Second Example
= {
"fields": "title, sku"
}
@data = @mints_user.get_sku(1, )
39 40 41 |
# File 'lib/user/ecommerce/skus.rb', line 39 def get_sku(id, = nil) return @client.raw("get", "/ecommerce/skus/#{id}", ) end |
permalink #get_skus(options = nil) ⇒ Object
Get skus.
Get a collection of skus.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_user.get_skus
Second Example
= {
"fields": "sku"
}
@data = @mints_user.get_skus()
20 21 22 |
# File 'lib/user/ecommerce/skus.rb', line 20 def get_skus( = nil) return @client.raw("get", "/ecommerce/skus", ) end |
permalink #update_sku(id, data) ⇒ Object
Update sku.
Update a sku info.
Parameters
- id
-
(Integer) – Sku id.
- data
-
(Hash) – Data to be submited.
Example
data = {
"sku": "NEW-SKU-XXXXXY"
}
@data = @mints_user.update_sku(531, data)
73 74 75 |
# File 'lib/user/ecommerce/skus.rb', line 73 def update_sku(id, data) return @client.raw("put", "/ecommerce/skus/#{id}", nil, data_transform(data)) end |