Module: Mural::Client::MuralContent::Shapes
- Included in:
- Mural::Client::MuralContent
- Defined in:
- lib/mural/client/mural_content/shapes.rb
Instance Method Summary collapse
-
#create_shapes(mural_id, create_shape_params) ⇒ Object
Create one or more shape widgets on a mural.
-
#update_shape(mural_id, shape_id, update_shape_params) ⇒ Object
Update a shape widget on a mural.
Instance Method Details
#create_shapes(mural_id, create_shape_params) ⇒ Object
Create one or more shape widgets on a mural. Limit 1000.
Authorization scope: murals:write
12 13 14 15 16 17 18 19 20 |
# File 'lib/mural/client/mural_content/shapes.rb', line 12 def create_shapes(mural_id, create_shape_params) json = post( "/api/public/v1/murals/#{mural_id}/widgets/shape", [*create_shape_params].map(&:encode) ) json['value'].map do |json_shape| Mural::Widget.decode(json_shape) end end |
#update_shape(mural_id, shape_id, update_shape_params) ⇒ Object
Update a shape widget on a mural.
Authorization scope: murals:write
27 28 29 30 31 32 33 34 |
# File 'lib/mural/client/mural_content/shapes.rb', line 27 def update_shape(mural_id, shape_id, update_shape_params) json = patch( "/api/public/v1/murals/#{mural_id}/widgets/shape/#{shape_id}", update_shape_params.encode ) Mural::Widget.decode(json['value']) end |