Module: Mural::Client::MuralContent::TextBoxes

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

Instance Method Summary collapse

Instance Method Details

#create_text_boxes(mural_id, create_text_box_params) ⇒ Object

Create one or more text box widgets on a mural. Limit 1000.

Authorization scope: murals:write

developers.mural.co/public/reference/createtextbox



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

def create_text_boxes(mural_id, create_text_box_params)
  json = post(
    "/api/public/v1/murals/#{mural_id}/widgets/textbox",
    [*create_text_box_params].map(&:encode)
  )

  json['value'].map { |text_box| Mural::Widget.decode(text_box) }
end

#update_text_box(mural_id, text_box_id, update_text_box_params) ⇒ Object

Update a textbox on a mural

Authorization scope: murals:write

developers.mural.co/public/reference/updatetextbox



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

def update_text_box(mural_id, text_box_id, update_text_box_params)
  json = patch(
    "/api/public/v1/murals/#{mural_id}/widgets/textbox/#{text_box_id}",
    update_text_box_params.encode
  )

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