Module: BaseApi::Client::Categories

Included in:
BaseApi::Client
Defined in:
lib/base_api/client/categories.rb

Instance Method Summary collapse

Instance Method Details

#categories(&block) ⇒ HTTParty::Response

Returns:

  • (HTTParty::Response)

See Also:



6
7
8
# File 'lib/base_api/client/categories.rb', line 6

def categories(&block)
  call_get_api('/1/categories', &block)
end

#categories_add(name, option = {}, &block) ⇒ HTTParty::Response

Parameters:

  • name (String)
  • param (Hash)

    a customizable set of options

Returns:

  • (HTTParty::Response)

See Also:



14
15
16
# File 'lib/base_api/client/categories.rb', line 14

def categories_add(name, option = {}, &block)
  call_post_api('/1/categories/add',  { name: name }.merge(option), &block)
end

#categories_delete(category_id, &block) ⇒ HTTParty::Response

Parameters:

  • category_id (Integer|String)

Returns:

  • (HTTParty::Response)

See Also:



29
30
31
# File 'lib/base_api/client/categories.rb', line 29

def categories_delete(category_id, &block)
  call_post_api('/1/categories/delete', { category_id: category_id }, &block)
end

#categories_edit(category_id, option = {}, &block) ⇒ HTTParty::Response

Parameters:

  • category_id (Integer|String)
  • param (Hash)

    a customizable set of options

Returns:

  • (HTTParty::Response)

See Also:



22
23
24
# File 'lib/base_api/client/categories.rb', line 22

def categories_edit(category_id, option = {}, &block)
  call_post_api('/1/categories/edit',  { category_id: category_id }.merge(option), &block)
end