Module: PlentyClient::Comment

Includes:
Endpoint, Request
Defined in:
lib/plenty_client/comment.rb

Constant Summary collapse

FIND_COMMENT =
'/comments/{commentId}'.freeze
LIST_COMMENTS =
'/comments/{referenceType}/{referenceValue}'.freeze
CREATE_COMMENT =
'/comments'.freeze
DELETE_COMMENT =
'/comments/{commentId}'.freeze

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.create(body = {}) ⇒ Object



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

def create(body = {})
  post(CREATE_CATEGORY, body)
end

.destroy(cat_id, body = {}) ⇒ Object



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

def destroy(cat_id, body = {})
  delete(build_endpoint(DELETE_CATEGORY, comment: cat_id), body)
end

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



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

def find(comment_id, headers = {}, &block)
  get(build_endpoint(FIND_COMMENT, comment: comment_id), headers, &block)
end

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



12
13
14
15
16
# File 'lib/plenty_client/comment.rb', line 12

def list(reference_type, reference_value, headers = {}, &block)
  get(build_endpoint(LIST_COMMENTS,
                     reference_type: reference_type,
                     reference_value: reference_value), headers, &block)
end