Module: PublicTaxonomies

Included in:
PublicConfig
Defined in:
lib/pub/config/taxonomies.rb

Instance Method Summary collapse

Instance Method Details

#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_pub.get_taxonomies

Second Example

options = {
  fields: 'id, title'
}
@data = @mints_pub.get_taxonomies(options)

Third Example

options = {
  fields: 'id, title'
}
@data = @mints_pub.get_taxonomies(options, false)


26
27
28
# File 'lib/pub/config/taxonomies.rb', line 26

def get_taxonomies(options = nil, use_post = true)
  get_query_results('/config/taxonomies', options, use_post)
end

#get_taxonomy(slug, options = nil) ⇒ Object

Get Taxonomy.

Get a single taxonomy.

Parameters

slug

(String) – It’s the string identifier generated by Mints.

options

(Hash) – List of Single Resource Options shown above can be used as parameter.

First Example

@data = @mints_pub.get_taxonomy('taxonomy_slug')

Second Example

options = {
  fields: 'title'
}
@data = @mints_pub.get_taxonomy('taxonomy_slug', options)


46
47
48
# File 'lib/pub/config/taxonomies.rb', line 46

def get_taxonomy(slug, options = nil)
  @client.raw('get', "/config/taxonomies/#{slug}", options)
end