Module: Locations
- Included in:
- Ecommerce
- Defined in:
- lib/user/ecommerce/locations.rb
Instance Method Summary collapse
-
#create_location(data, options = nil) ⇒ Object
Create location.
-
#create_location_template(data) ⇒ Object
Create location template.
-
#delete_location(id) ⇒ Object
Delete location.
-
#get_location(id) ⇒ Object
Get location.
-
#get_location_template(id, options = nil) ⇒ Object
Get location template.
-
#get_location_template_support_data(id) ⇒ Object
Get location template support data.
-
#get_location_templates(options = nil) ⇒ Object
Get location templates.
-
#get_location_templates_support_data ⇒ Object
Get location templates support data.
-
#get_locations(options = nil, use_post = true) ⇒ Object
options = { “fields”: “id, title” } @data = @mints_user.get_locations(options).
-
#update_location(id, data, options = nil) ⇒ Object
Update location.
-
#update_location_template(id, data) ⇒ Object
Update location template.
Instance Method Details
permalink #create_location(data, options = nil) ⇒ Object
Create location.
Create a location with data.
Parameters
- data
-
(Hash) – Data to be submitted.
Example
data = {
"title": "New Location",
"location_template_id": 1
}
@data = @mints_user.create_location(data)
48 49 50 |
# File 'lib/user/ecommerce/locations.rb', line 48 def create_location(data, = nil) return @client.raw("post", "/ecommerce/locations", , data_transform(data)) end |
permalink #create_location_template(data) ⇒ Object
Create location template.
Create a location template with data.
Parameters
- data
-
(Hash) – Data to be submitted.
Example
data = {
"title": "New Location Template",
"slug": "new-location-template"
}
@data = @mints_user.create_location_template(data)
150 151 152 |
# File 'lib/user/ecommerce/locations.rb', line 150 def create_location_template(data) return @client.raw("post", "/ecommerce/location-templates", nil, data_transform(data)) end |
permalink #delete_location(id) ⇒ Object
Delete location.
Delete a location.
Parameters
- id
-
(Integer) – Location id.
Example
@data = @mints_user.delete_location(5)
76 77 78 |
# File 'lib/user/ecommerce/locations.rb', line 76 def delete_location(id) return @client.raw("delete", "/ecommerce/locations/#{id}") end |
permalink #get_location(id) ⇒ Object
Get location.
Get a location info.
Parameters
- id
-
(Integer) – Location id.
Example
@data = @mints_user.get_location(2)
32 33 34 |
# File 'lib/user/ecommerce/locations.rb', line 32 def get_location(id) return @client.raw("get", "/ecommerce/locations/#{id}") end |
permalink #get_location_template(id, options = nil) ⇒ Object
Get location template.
Get a location template info.
Parameters
- id
-
(Integer) – Location template id.
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_user.get_location_template(1)
Second Example
= { "fields": "title" }
@data = @mints_user.get_location_template(1, )
134 135 136 |
# File 'lib/user/ecommerce/locations.rb', line 134 def get_location_template(id, = nil) return @client.raw("get", "/ecommerce/location-templates/#{id}", ) end |
permalink #get_location_template_support_data(id) ⇒ Object
Get location template support data.
Get support data used in a location template.
Parameters
- id
-
(Integer) – Location template id.
Example
@data = @mints_user.get_location_template_support_data(1)
92 93 94 |
# File 'lib/user/ecommerce/locations.rb', line 92 def get_location_template_support_data(id) return @client.raw("get", "/ecommerce/location-templates/#{id}/support-data") end |
permalink #get_location_templates(options = nil) ⇒ Object
Get location templates.
Get a collection of location templates.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_user.get_location_templates
Second Example
= { "fields": "title" }
@data = @mints_user.get_location_templates()
117 118 119 |
# File 'lib/user/ecommerce/locations.rb', line 117 def get_location_templates( = nil) return @client.raw("get", "/ecommerce/location-templates", ) end |
permalink #get_location_templates_support_data ⇒ Object
Get location templates support data.
Get support data used in location templates.
Example
@data = @mints_user.get_location_templates_support_data
101 102 103 |
# File 'lib/user/ecommerce/locations.rb', line 101 def get_location_templates_support_data return @client.raw("get", "/ecommerce/location-templates/support-data") end |
permalink #get_locations(options = nil, use_post = true) ⇒ Object
options = {
"fields": "id, title"
}
@data = @mints_user.get_locations(options)
20 21 22 |
# File 'lib/user/ecommerce/locations.rb', line 20 def get_locations( = nil, use_post = true) return get_query_results("/ecommerce/locations", , use_post) end |
permalink #update_location(id, data, options = nil) ⇒ Object
Update location.
Update a location info.
Parameters
- id
-
(Integer) – Location id.
- data
-
(Hash) – Data to be submitted.
Example
data = {
"title": "New Location Modified"
}
@data = @mints_user.update_location(5, data.to_json)
64 65 66 |
# File 'lib/user/ecommerce/locations.rb', line 64 def update_location(id, data, = nil) return @client.raw("put", "/ecommerce/locations/#{id}", , data) end |
permalink #update_location_template(id, data) ⇒ Object
Update location template.
Update a location template info.
Parameters
- id
-
(Integer) – Location template id.
- data
-
(Hash) – Data to be submitted.
Example
data = {
"title": "New Location Template Modified"
}
@data = @mints_user.update_location_template(3, data)
166 167 168 |
# File 'lib/user/ecommerce/locations.rb', line 166 def update_location_template(id, data) return @client.raw("put", "/ecommerce/location-templates/#{id}", nil, data_transform(data)) end |