Class: PlentyClient::Item::Unit

Inherits:
Object
  • Object
show all
Extended by:
Endpoint, Request
Defined in:
lib/plenty_client/item/unit.rb

Constant Summary collapse

CREATE_ITEMS_UNITS =
'/items/{itemId}/units'.freeze
GET_ITEMS_UNIT =
'/items/{itemId}/units'.freeze
DELETE_ITEMS_UNIT =
'/items/{itemId}/units/{unitId}'.freeze

Class Method Summary collapse

Methods included from Endpoint

build_endpoint, routes

Methods included from Request

delete, get, patch, post, put, request

Class Method Details

.create(headers = {}) ⇒ Object



13
14
15
# File 'lib/plenty_client/item/unit.rb', line 13

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

.delete(unit_id) ⇒ Object



29
30
31
# File 'lib/plenty_client/item/unit.rb', line 29

def delete(unit_id)
  delete(build_endpoint(DELETE_ITEMS_UNIT, unit: unit_id))
end

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



21
22
23
# File 'lib/plenty_client/item/unit.rb', line 21

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

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



17
18
19
# File 'lib/plenty_client/item/unit.rb', line 17

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

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



25
26
27
# File 'lib/plenty_client/item/unit.rb', line 25

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