Module: PlentyClient::Comment

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

Constant Summary collapse

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

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.create(body = {}) ⇒ Object



24
25
26
# File 'lib/plenty_client/comment.rb', line 24

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

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



28
29
30
# File 'lib/plenty_client/comment.rb', line 28

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

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



20
21
22
# File 'lib/plenty_client/comment.rb', line 20

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



14
15
16
17
18
# File 'lib/plenty_client/comment.rb', line 14

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