Module: Mural::Client::MuralContent::Comments

Included in:
Mural::Client::MuralContent
Defined in:
lib/mural/client/mural_content/comments.rb

Instance Method Summary collapse

Instance Method Details

#create_comment(mural_id, create_comment_params) ⇒ Object

Create a comment widget on a mural.

Authorization scope: murals:write

developers.mural.co/public/reference/createcomment



12
13
14
15
16
17
18
19
# File 'lib/mural/client/mural_content/comments.rb', line 12

def create_comment(mural_id, create_comment_params)
  json = post(
    "/api/public/v1/murals/#{mural_id}/widgets/comment",
    create_comment_params.encode
  )

  Mural::Widget.decode(json['value'])
end

#update_comment(mural_id, comment_id, update_comment_params) ⇒ Object

Update a comment widget on a mural.

Authorization scope: murals:write

developers.mural.co/public/reference/updatecomment



26
27
28
29
30
31
32
33
# File 'lib/mural/client/mural_content/comments.rb', line 26

def update_comment(mural_id, comment_id, update_comment_params)
  json = patch(
    "/api/public/v1/murals/#{mural_id}/widgets/comment/#{comment_id}",
    update_comment_params.encode
  )

  Mural::Widget.decode(json['value'])
end