Class: PlentyClient::Item::Attribute::ValueName

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

Constant Summary collapse

ITEM_ATTRIBUTE_PATH =
'/items/attribute_values'
CREATE_ITEM_ATTRIBUTE_VALUES =
'/{attributeValueId}/names'
LIST_ITEM_ATTRIBUTE_VALUE =
'/{attributeValueId}/names'
GET_ITEMS_ATTRIBUTE_VALUE =
'/{attributeValueId}/names/{lang}'
UPDATE_ITEMS_ATTRIBUTE_VALUE =
'/{attributeValueId}/names/{lang}'
DELETE_ITEMS_ATTRIBUTE_VALUE =
'/{attributeValueId}/names/{lang}'

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.create(attribute_value_id, body = {}) ⇒ Object



19
20
21
22
23
# File 'lib/plenty_client/item/attribute/value_name.rb', line 19

def create(attribute_value_id, body = {})
  post(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{CREATE_ITEM_ATTRIBUTE_VALUES}",
                      attribute_value: attribute_value_id),
       body)
end

.destroy(attribute_value_id, _value_id) ⇒ Object



45
46
47
48
49
# File 'lib/plenty_client/item/attribute/value_name.rb', line 45

def destroy(attribute_value_id, _value_id)
  delete(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{DELETE_ITEMS_ATTRIBUTE_VALUE}",
                        attribute_value: attribute_value_id,
                        lang: lang))
end

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



31
32
33
34
35
36
# File 'lib/plenty_client/item/attribute/value_name.rb', line 31

def find(attribute_value_id, lang, headers = {}, &block)
  get(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{GET_ITEMS_ATTRIBUTE_VALUE}",
                     attribute_value: attribute_value_id,
                     lang: lang),
      headers, &block)
end

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



25
26
27
28
29
# File 'lib/plenty_client/item/attribute/value_name.rb', line 25

def list(attribute_value_id, headers = {}, &block)
  get(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{LIST_ITEM_ATTRIBUTE_VALUE}",
                     attribute_value: attribute_value_id),
      headers, &block)
end

.update(attribute_value_id, lang, body = {}, &block) ⇒ Object



38
39
40
41
42
43
# File 'lib/plenty_client/item/attribute/value_name.rb', line 38

def update(attribute_value_id, lang, body = {}, &block)
  put(build_endpoint("#{ITEM_ATTRIBUTE_PATH}#{UPDATE_ITEMS_ATTRIBUTE_VALUE}",
                     attribute_value: attribute_value_id,
                     lang: lang),
      body, &block)
end