Module: Taxonomies
- Included in:
- Config
- Defined in:
- lib/user/config/taxonomies.rb
Instance Method Summary collapse
-
#create_taxonomy(data, options = nil) ⇒ Object
Create taxonomy.
-
#get_taxonomies(options = nil, use_post = true) ⇒ Object
Get taxonomies.
-
#get_taxonomies_for_object(options) ⇒ Object
Get taxonomies for object.
-
#get_taxonomies_support_data ⇒ Object
Get taxonomies support data.
-
#get_taxonomy(id, options = nil) ⇒ Object
Get taxonomy.
-
#sync_taxonomies_for_object(data) ⇒ Object
Taxonomies.
-
#update_taxonomy(id, data, options = nil) ⇒ Object
Update taxonomy.
Instance Method Details
#create_taxonomy(data, options = nil) ⇒ Object
Create taxonomy.
Create a taxonomy with data.
Parameters
- data
-
(Hash) – Data to be submitted.
Example
data = {
title: 'New Taxonomy',
slug: 'new-taxonomy',
object_type: 'contacts'
}
@data = @mints_user.create_taxonomy(data)
99 100 101 |
# File 'lib/user/config/taxonomies.rb', line 99 def create_taxonomy(data, = nil) @client.raw('post', '/config/taxonomies', , data_transform(data)) end |
#get_taxonomies(options = nil, use_post = true) ⇒ Object
Get taxonomies.
Get a collection of taxonomies.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
- use_post
-
(Boolean) – Variable to determine if the request is by ‘post’ or ‘get’ functions.
First Example
@data = @mints_user.get_taxonomies
Second Example
= { fields: 'title' }
@data = @mints_user.get_taxonomies()
Third Example
= { fields: 'title' }
@data = @mints_user.get_taxonomies(, false)
65 66 67 |
# File 'lib/user/config/taxonomies.rb', line 65 def get_taxonomies( = nil, use_post = true) get_query_results('/config/taxonomies', , use_post) end |
#get_taxonomies_for_object(options) ⇒ Object
Get taxonomies for object.
Get taxonomies for object.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
Example
= {
object_type: "contacts",
object_id: 1
}
@data = @mints_user.get_taxonomies_for_object()
35 36 37 |
# File 'lib/user/config/taxonomies.rb', line 35 def get_taxonomies_for_object() @client.raw('get', '/config/taxonomies/get_taxonomies_for_object', ) end |
#get_taxonomies_support_data ⇒ Object
Get taxonomies support data.
Get support data used in taxonomies.
Example
@data = @mints_user.get_taxonomies_support_data
44 45 46 |
# File 'lib/user/config/taxonomies.rb', line 44 def get_taxonomies_support_data @client.raw('get', '/config/taxonomies/support-data') end |
#get_taxonomy(id, options = nil) ⇒ Object
Get taxonomy.
Get a taxonomy info.
Parameters
- id
-
(Integer) – Taxonomy id.
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_user.get_taxonomy(1)
Second Example
= { fields: 'title' }
@data = @mints_user.get_taxonomy(1, )
82 83 84 |
# File 'lib/user/config/taxonomies.rb', line 82 def get_taxonomy(id, = nil) @client.raw('get', "/config/taxonomies/#{id}", ) end |
#sync_taxonomies_for_object(data) ⇒ Object
Taxonomies
Sync taxonomies for object.
Sync taxonomies for object.
Parameters
- data
-
(Hash) – Data to be submitted.
Example
data = {
object_type: 'contacts',
object_id: 1
}
@data = @mints_user.sync_taxonomies_for_object(data)
19 20 21 |
# File 'lib/user/config/taxonomies.rb', line 19 def sync_taxonomies_for_object(data) @client.raw('put', '/config/taxonomies/sync_taxonomies_for_object', nil, data_transform(data)) end |
#update_taxonomy(id, data, options = nil) ⇒ Object
Update taxonomy.
Update a taxonomy info.
Parameters
- id
-
(Integer) – Taxonomy id.
- data
-
(Hash) – Data to be submitted.
Example
data = {
title: "New Taxonomy Modified",
slug: "new-taxonomy",
object_type: "contacts"
}
@data = @mints_user.update_taxonomy(104, data)
117 118 119 |
# File 'lib/user/config/taxonomies.rb', line 117 def update_taxonomy(id, data, = nil) @client.raw('put', "/config/taxonomies/#{id}", , data_transform(data)) end |