Module: BaseApi::Client::Items

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

Instance Method Summary collapse

Instance Method Details

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

Parameters:

  • params (Hash)

    a customizable set of options

Returns:

  • (HTTParty::Response)

See Also:



7
8
9
# File 'lib/base_api/client/items.rb', line 7

def items(option = {}, &block)
  paginate('/1/items', option, &block)
end

#items_add(item, &block) ⇒ HTTParty::Response

Parameters:

  • item (Hash)

Returns:

  • (HTTParty::Response)

See Also:



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

def items_add(item, &block)
  call_post_api('/1/items/add', item, &block)
end

#items_add_image(item_image, &block) ⇒ HTTParty::Response

Parameters:

  • item_image (Hash)

Returns:

  • (HTTParty::Response)

See Also:



50
51
52
# File 'lib/base_api/client/items.rb', line 50

def items_add_image(item_image, &block)
  call_post_api('/1/items/add_image', item_image, &block)
end

#items_delete(item_id, &block) ⇒ HTTParty::Response

Parameters:

  • item_id (Integer|String)

Returns:

  • (HTTParty::Response)

See Also:



43
44
45
# File 'lib/base_api/client/items.rb', line 43

def items_delete(item_id, &block)
  call_post_api('/1/items/delete', { item_id: item_id }, &block)
end

#items_delete_image(item_id, image_no, &block) ⇒ HTTParty::Response

Parameters:

  • item_id (Integer|String)
  • image_no: (Integer|String)

    from 1 to 20

Returns:

  • (HTTParty::Response)

See Also:



58
59
60
# File 'lib/base_api/client/items.rb', line 58

def items_delete_image(item_id, image_no, &block)
  call_post_api('/1/items/delete_image', { item_id: item_id, image_no: image_no }, &block)
end

#items_delete_variation(item_id, variation_id, &block) ⇒ HTTParty::Response

Parameters:

  • item_id (Integer|String)
  • variation_id (Integer|String)

Returns:

  • (HTTParty::Response)

See Also:



73
74
75
# File 'lib/base_api/client/items.rb', line 73

def items_delete_variation(item_id, variation_id, &block)
  call_post_api('/1/items/delete_variation', { item_id: item_id, variation_id: variation_id }, &block)
end

#items_detail(item_id, &block) ⇒ HTTParty::Response

Parameters:

  • item_id (Integer | String)

Returns:

  • (HTTParty::Response)

See Also:



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

def items_detail(item_id, &block)
  call_get_api("/1/items/detail/#{item_id}", &block)
end

#items_edit(item, &block) ⇒ HTTParty::Response

Parameters:

  • item (Hash)

Returns:

  • (HTTParty::Response)

See Also:



36
37
38
# File 'lib/base_api/client/items.rb', line 36

def items_edit(item, &block)
  call_post_api('/1/items/edit', item, &block)
end

#items_edit_stock(params, &block) ⇒ HTTParty::Response

Parameters:

  • params (Hash)

Returns:

  • (HTTParty::Response)

See Also:



65
66
67
# File 'lib/base_api/client/items.rb', line 65

def items_edit_stock(params, &block)
  call_post_api('/1/items/edit_stock', params, &block)
end

#items_search(q, option = {}, &block) ⇒ HTTParty::Response

Parameters:

  • q: (String)

    search word

  • params (Hash)

    a customizable set of options

Returns:

  • (HTTParty::Response)

See Also:



15
16
17
# File 'lib/base_api/client/items.rb', line 15

def items_search(q, option = {}, &block)
  paginate('/1/items/search', { q: q }.merge(option), &block)
end