Module: PlentyClient::Item::Attribute

Includes:
Endpoint, Request
Defined in:
lib/plenty_client.rb,
lib/plenty_client/item/attribute.rb,
lib/plenty_client/item/attribute/name.rb,
lib/plenty_client/item/attribute/value.rb,
lib/plenty_client/item/attribute/value_name.rb

Defined Under Namespace

Classes: Name, Value, ValueName

Constant Summary collapse

CREATE_ATTRIBUTE =
'/items/attributes'.freeze
LIST_ATTRIBUTES =
'/items/attributes'.freeze
GET_ATTRIBUTE =
'/items/attributes/{attributeId}'.freeze
UPDATE_ATTRIBUTE =
'/items/attributes/{attributeId}'.freeze
DELETE_ATTRIBUTE =
'/items/attributes/{attributeId}'.freeze

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.create(headers = {}) ⇒ Object



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

def create(headers = {})
  post(build_endpoint(CREATE_ATTRIBUTE), headers)
end

.destroy(attribute_id) ⇒ Object



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

def destroy(attribute_id)
  delete(build_endpoint(DELETE_attribute, attribute: attribute_id))
end

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



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

def find(attribute_id, headers = {}, &block)
  get(build_endpoint(GET_ATTRIBUTE, attribute: attribute_id), headers, &block)
end

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



14
15
16
# File 'lib/plenty_client/item/attribute.rb', line 14

def list(headers = {}, &block)
  get(build_endpoint(LIST_ATTRIBUTES), headers, &block)
end

.update(attribute_id, headers = {}) ⇒ Object



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

def update(attribute_id, headers = {})
  post(build_endpoint(UPDATE_ATTRIBUTE, attribute: attribute_id), headers)
end