Class: PlentyClient::Item::UnitName

Inherits:
Object
  • Object
show all
Includes:
Endpoint, Request
Defined in:
lib/plenty_client/item/unit_name.rb

Constant Summary collapse

LIST_ITEM_UNIT_NAMES =
'/item/units/{unitID}/names'
FIND_ITEM_UNIT_NAME =
'/item/units/{unitID}/names/{lang}'
CREATE_ITEMS_UNIT_NAME =
'/item/units/{unitID}/names'
UPDATE_ITEMS_UNIT_NAME =
'/item/units/{unitID}/names/{lang}'
DELETE_ITEMS_UNIT_NAME =
'/item/units/{unitID}/names/{lang}'

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.create(unit_id, headers = {}) ⇒ Object



26
27
28
# File 'lib/plenty_client/item/unit_name.rb', line 26

def create(unit_id, headers = {})
  post(build_endpoint(CREATE_ITEMS_UNIT_NAME, unit: unit_id), headers)
end

.destroy(unit_id, lang) ⇒ Object



34
35
36
# File 'lib/plenty_client/item/unit_name.rb', line 34

def destroy(unit_id, lang)
  delete(build_endpoint(DELETE_ITEMS_UNIT_NAME, unit: unit_id, lang: lang))
end

.find(unit_id, lang, headers = {}, &block) ⇒ Object



22
23
24
# File 'lib/plenty_client/item/unit_name.rb', line 22

def find(unit_id, lang, headers = {}, &block)
  get(build_endpoint(FIND_ITEM_UNIT_NAME, unit: unit_id, lang: lang), headers, &block)
end

.list(unit_id, headers = {}, &block) ⇒ Object



18
19
20
# File 'lib/plenty_client/item/unit_name.rb', line 18

def list(unit_id, headers = {}, &block)
  get(build_endpoint(LIST_ITEM_UNIT_NAMES, unit: unit_id), headers, &block)
end

.update(unit_id, lang, headers = {}, &block) ⇒ Object



30
31
32
# File 'lib/plenty_client/item/unit_name.rb', line 30

def update(unit_id, lang, headers = {}, &block)
  put(build_endpoint(UPDATE_ITEMS_UNIT_NAME, unit: unit_id, lang: lang), headers, &block)
end