Module: VariantOptions
- Included in:
- Ecommerce
- Defined in:
- lib/user/ecommerce/variant_options.rb
Instance Method Summary collapse
-
#create_variant_option(data) ⇒ Object
Create variant option.
-
#get_variant_option(id, options = nil) ⇒ Object
Get variant option.
-
#get_variant_options(options = nil) ⇒ Object
Get variant options.
-
#update_variant_option(id, data) ⇒ Object
Update variant option.
Instance Method Details
permalink #create_variant_option(data) ⇒ Object
Create variant option.
Create a variant option with data.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"title": "New Variant Option"
}
@data = @mints_user.create_variant_option(data)
50 51 52 |
# File 'lib/user/ecommerce/variant_options.rb', line 50 def create_variant_option(data) return @client.raw("post", "/ecommerce/variant-options", nil, data_transform(data)) end |
permalink #get_variant_option(id, options = nil) ⇒ Object
Get variant option.
Get a variant options info.
Parameters
- id
-
(Integer) – Variant option id.
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_user.get_variant_option(1)
Second Example
= { "fields": "id, title" }
@data = @mints_user.get_variant_option(1, )
35 36 37 |
# File 'lib/user/ecommerce/variant_options.rb', line 35 def get_variant_option(id, = nil) return @client.raw("get", "/ecommerce/variant-options/#{id}", ) end |
permalink #get_variant_options(options = nil) ⇒ Object
Get variant options.
Get a collection of variant options.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_user.
Second Example
= { "fields": "id, title" }
@data = @mints_user.()
18 19 20 |
# File 'lib/user/ecommerce/variant_options.rb', line 18 def ( = nil) return @client.raw("get", "/ecommerce/variant-options", ) end |
permalink #update_variant_option(id, data) ⇒ Object
Update variant option.
Update a variant option info.
Parameters
- id
-
(Integer) – Variant option id.
- data
-
(Hash) – Data to be submited.
Example
data = {
"title": "New Variant Option Modified"
}
@data = @mints_user.update_variant_option(6, data)
66 67 68 |
# File 'lib/user/ecommerce/variant_options.rb', line 66 def update_variant_option(id, data) return @client.raw("put", "/ecommerce/variant-options/#{id}", nil, data_transform(data)) end |