Module: DrawioDsl::DomBuilderShapes
- Included in:
- DomBuilder
- Defined in:
- lib/drawio_dsl/dom_builder_shapes.rb
Overview
DrawioDsl is a DSL for draw-io diagrams.
Instance Method Summary collapse
- #add_actor(id = nil, **opts, &block) ⇒ Object
- #add_actor2(id = nil, **opts, &block) ⇒ Object
- #add_callout(id = nil, **opts, &block) ⇒ Object
- #add_callout2(id = nil, **opts, &block) ⇒ Object
- #add_callout3(id = nil, **opts, &block) ⇒ Object
- #add_callout4(id = nil, **opts, &block) ⇒ Object
- #add_circle(id = nil, **opts, &block) ⇒ Object
- #add_cloud(id = nil, **opts, &block) ⇒ Object
- #add_container(id = nil, **opts, &block) ⇒ Object
- #add_container2(id = nil, **opts, &block) ⇒ Object
- #add_container3(id = nil, **opts, &block) ⇒ Object
- #add_container4(id = nil, **opts, &block) ⇒ Object
- #add_cross(id = nil, **opts, &block) ⇒ Object
- #add_dash(id = nil, **opts, &block) ⇒ Object
- #add_dash24(id = nil, **opts, &block) ⇒ Object
- #add_dash32(id = nil, **opts, &block) ⇒ Object
- #add_dash44(id = nil, **opts, &block) ⇒ Object
- #add_dash_dot(id = nil, **opts, &block) ⇒ Object
- #add_dash_dot_dot(id = nil, **opts, &block) ⇒ Object
- #add_dash_long_dash(id = nil, **opts, &block) ⇒ Object
- #add_database(id = nil, **opts, &block) ⇒ Object
- #add_db_json(id = nil, **opts, &block) ⇒ Object
- #add_diamond(id = nil, **opts, &block) ⇒ Object
- #add_document(id = nil, **opts, &block) ⇒ Object
- #add_dot(id = nil, **opts, &block) ⇒ Object
- #add_dot_dot_dot(id = nil, **opts, &block) ⇒ Object
- #add_double(id = nil, **opts, &block) ⇒ Object
- #add_double_dash(id = nil, **opts, &block) ⇒ Object
- #add_double_dot(id = nil, **opts, &block) ⇒ Object
- #add_ellipse(id = nil, **opts, &block) ⇒ Object
- #add_embed_col200(id = nil, **opts, &block) ⇒ Object
- #add_embed_col50(id = nil, **opts, &block) ⇒ Object
- #add_embed_row(id = nil, **opts, &block) ⇒ Object
- #add_envelop(id = nil, **opts, &block) ⇒ Object
- #add_face(id = nil, **opts, &block) ⇒ Object
- #add_group(id = nil, **opts, &block) ⇒ Object
- #add_h1(id = nil, **opts, &block) ⇒ Object
- #add_h2(id = nil, **opts, &block) ⇒ Object
- #add_h3(id = nil, **opts, &block) ⇒ Object
- #add_h4(id = nil, **opts, &block) ⇒ Object
- #add_h5(id = nil, **opts, &block) ⇒ Object
- #add_h6(id = nil, **opts, &block) ⇒ Object
- #add_hexagon(id = nil, **opts, &block) ⇒ Object
- #add_interface(id = nil, **opts, &block) ⇒ Object
- #add_klass(id = nil, **opts, &block) ⇒ Object
- #add_long_dash(id = nil, **opts, &block) ⇒ Object
- #add_note(id = nil, **opts, &block) ⇒ Object
- #add_p(id = nil, **opts, &block) ⇒ Object
- #add_process(id = nil, **opts, &block) ⇒ Object
- #add_rectangle(id = nil, **opts, &block) ⇒ Object
- #add_rectangle2(id = nil, **opts, &block) ⇒ Object
- #add_solid(id = nil, **opts, &block) ⇒ Object
- #add_square(id = nil, **opts, &block) ⇒ Object
- #add_step(id = nil, **opts, &block) ⇒ Object
- #add_tick(id = nil, **opts, &block) ⇒ Object
- #add_todo(id = nil, **opts, &block) ⇒ Object
- #add_triangle(id = nil, **opts, &block) ⇒ Object
Instance Method Details
#add_actor(id = nil, **opts, &block) ⇒ Object
133 134 135 136 137 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 133 def add_actor(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id actor = DrawioDsl::Schema::Actor.new(current_page, **opts, &block) add_shape(actor) end |
#add_actor2(id = nil, **opts, &block) ⇒ Object
139 140 141 142 143 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 139 def add_actor2(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id actor2 = DrawioDsl::Schema::Actor2.new(current_page, **opts, &block) add_shape(actor2) end |
#add_callout(id = nil, **opts, &block) ⇒ Object
145 146 147 148 149 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 145 def add_callout(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id callout = DrawioDsl::Schema::Callout.new(current_page, **opts, &block) add_shape(callout) end |
#add_callout2(id = nil, **opts, &block) ⇒ Object
151 152 153 154 155 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 151 def add_callout2(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id callout2 = DrawioDsl::Schema::Callout2.new(current_page, **opts, &block) add_shape(callout2) end |
#add_callout3(id = nil, **opts, &block) ⇒ Object
157 158 159 160 161 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 157 def add_callout3(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id callout3 = DrawioDsl::Schema::Callout3.new(current_page, **opts, &block) add_shape(callout3) end |
#add_callout4(id = nil, **opts, &block) ⇒ Object
163 164 165 166 167 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 163 def add_callout4(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id callout4 = DrawioDsl::Schema::Callout4.new(current_page, **opts, &block) add_shape(callout4) end |
#add_circle(id = nil, **opts, &block) ⇒ Object
169 170 171 172 173 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 169 def add_circle(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id circle = DrawioDsl::Schema::Circle.new(current_page, **opts, &block) add_shape(circle) end |
#add_cloud(id = nil, **opts, &block) ⇒ Object
175 176 177 178 179 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 175 def add_cloud(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id cloud = DrawioDsl::Schema::Cloud.new(current_page, **opts, &block) add_shape(cloud) end |
#add_container(id = nil, **opts, &block) ⇒ Object
181 182 183 184 185 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 181 def add_container(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id container = DrawioDsl::Schema::Container.new(current_page, **opts, &block) add_shape(container) end |
#add_container2(id = nil, **opts, &block) ⇒ Object
187 188 189 190 191 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 187 def add_container2(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id container2 = DrawioDsl::Schema::Container2.new(current_page, **opts, &block) add_shape(container2) end |
#add_container3(id = nil, **opts, &block) ⇒ Object
193 194 195 196 197 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 193 def add_container3(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id container3 = DrawioDsl::Schema::Container3.new(current_page, **opts, &block) add_shape(container3) end |
#add_container4(id = nil, **opts, &block) ⇒ Object
199 200 201 202 203 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 199 def add_container4(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id container4 = DrawioDsl::Schema::Container4.new(current_page, **opts, &block) add_shape(container4) end |
#add_cross(id = nil, **opts, &block) ⇒ Object
205 206 207 208 209 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 205 def add_cross(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id cross = DrawioDsl::Schema::Cross.new(current_page, **opts, &block) add_shape(cross) end |
#add_dash(id = nil, **opts, &block) ⇒ Object
13 14 15 16 17 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 13 def add_dash(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id dash = DrawioDsl::Schema::Dash.new(current_page, **opts, &block) add_shape(dash) end |
#add_dash24(id = nil, **opts, &block) ⇒ Object
55 56 57 58 59 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 55 def add_dash24(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id dash24 = DrawioDsl::Schema::Dash24.new(current_page, **opts, &block) add_shape(dash24) end |
#add_dash32(id = nil, **opts, &block) ⇒ Object
61 62 63 64 65 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 61 def add_dash32(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id dash32 = DrawioDsl::Schema::Dash32.new(current_page, **opts, &block) add_shape(dash32) end |
#add_dash44(id = nil, **opts, &block) ⇒ Object
67 68 69 70 71 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 67 def add_dash44(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id dash44 = DrawioDsl::Schema::Dash44.new(current_page, **opts, &block) add_shape(dash44) end |
#add_dash_dot(id = nil, **opts, &block) ⇒ Object
25 26 27 28 29 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 25 def add_dash_dot(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id dash_dot = DrawioDsl::Schema::DashDot.new(current_page, **opts, &block) add_shape(dash_dot) end |
#add_dash_dot_dot(id = nil, **opts, &block) ⇒ Object
31 32 33 34 35 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 31 def add_dash_dot_dot(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id dash_dot_dot = DrawioDsl::Schema::DashDotDot.new(current_page, **opts, &block) add_shape(dash_dot_dot) end |
#add_dash_long_dash(id = nil, **opts, &block) ⇒ Object
49 50 51 52 53 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 49 def add_dash_long_dash(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id dash_long_dash = DrawioDsl::Schema::DashLongDash.new(current_page, **opts, &block) add_shape(dash_long_dash) end |
#add_database(id = nil, **opts, &block) ⇒ Object
217 218 219 220 221 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 217 def add_database(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id database = DrawioDsl::Schema::Database.new(current_page, **opts, &block) add_shape(database) end |
#add_db_json(id = nil, **opts, &block) ⇒ Object
223 224 225 226 227 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 223 def add_db_json(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id db_json = DrawioDsl::Schema::DbJson.new(current_page, **opts, &block) add_shape(db_json) end |
#add_diamond(id = nil, **opts, &block) ⇒ Object
229 230 231 232 233 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 229 def add_diamond(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id diamond = DrawioDsl::Schema::Diamond.new(current_page, **opts, &block) add_shape(diamond) end |
#add_document(id = nil, **opts, &block) ⇒ Object
235 236 237 238 239 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 235 def add_document(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id document = DrawioDsl::Schema::Document.new(current_page, **opts, &block) add_shape(document) end |
#add_dot(id = nil, **opts, &block) ⇒ Object
19 20 21 22 23 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 19 def add_dot(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id dot = DrawioDsl::Schema::Dot.new(current_page, **opts, &block) add_shape(dot) end |
#add_dot_dot_dot(id = nil, **opts, &block) ⇒ Object
37 38 39 40 41 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 37 def add_dot_dot_dot(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id dot_dot_dot = DrawioDsl::Schema::DotDotDot.new(current_page, **opts, &block) add_shape(dot_dot_dot) end |
#add_double(id = nil, **opts, &block) ⇒ Object
73 74 75 76 77 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 73 def add_double(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id double = DrawioDsl::Schema::Double.new(current_page, **opts, &block) add_shape(double) end |
#add_double_dash(id = nil, **opts, &block) ⇒ Object
79 80 81 82 83 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 79 def add_double_dash(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id double_dash = DrawioDsl::Schema::DoubleDash.new(current_page, **opts, &block) add_shape(double_dash) end |
#add_double_dot(id = nil, **opts, &block) ⇒ Object
85 86 87 88 89 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 85 def add_double_dot(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id double_dot = DrawioDsl::Schema::DoubleDot.new(current_page, **opts, &block) add_shape(double_dot) end |
#add_ellipse(id = nil, **opts, &block) ⇒ Object
241 242 243 244 245 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 241 def add_ellipse(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id ellipse = DrawioDsl::Schema::Ellipse.new(current_page, **opts, &block) add_shape(ellipse) end |
#add_embed_col200(id = nil, **opts, &block) ⇒ Object
343 344 345 346 347 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 343 def (id = nil, **opts, &block) opts = { id: id }.merge(opts) if id = DrawioDsl::Schema::EmbedCol200.new(current_page, **opts, &block) add_shape() end |
#add_embed_col50(id = nil, **opts, &block) ⇒ Object
337 338 339 340 341 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 337 def (id = nil, **opts, &block) opts = { id: id }.merge(opts) if id = DrawioDsl::Schema::EmbedCol50.new(current_page, **opts, &block) add_shape() end |
#add_embed_row(id = nil, **opts, &block) ⇒ Object
331 332 333 334 335 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 331 def (id = nil, **opts, &block) opts = { id: id }.merge(opts) if id = DrawioDsl::Schema::EmbedRow.new(current_page, **opts, &block) add_shape() end |
#add_envelop(id = nil, **opts, &block) ⇒ Object
211 212 213 214 215 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 211 def add_envelop(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id envelop = DrawioDsl::Schema::Envelop.new(current_page, **opts, &block) add_shape(envelop) end |
#add_face(id = nil, **opts, &block) ⇒ Object
319 320 321 322 323 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 319 def add_face(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id face = DrawioDsl::Schema::Face.new(current_page, **opts, &block) add_shape(face) end |
#add_group(id = nil, **opts, &block) ⇒ Object
247 248 249 250 251 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 247 def add_group(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id group = DrawioDsl::Schema::Group.new(current_page, **opts, &block) add_shape(group) end |
#add_h1(id = nil, **opts, &block) ⇒ Object
91 92 93 94 95 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 91 def add_h1(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id h1 = DrawioDsl::Schema::H1.new(current_page, **opts, &block) add_shape(h1) end |
#add_h2(id = nil, **opts, &block) ⇒ Object
97 98 99 100 101 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 97 def add_h2(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id h2 = DrawioDsl::Schema::H2.new(current_page, **opts, &block) add_shape(h2) end |
#add_h3(id = nil, **opts, &block) ⇒ Object
103 104 105 106 107 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 103 def add_h3(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id h3 = DrawioDsl::Schema::H3.new(current_page, **opts, &block) add_shape(h3) end |
#add_h4(id = nil, **opts, &block) ⇒ Object
109 110 111 112 113 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 109 def add_h4(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id h4 = DrawioDsl::Schema::H4.new(current_page, **opts, &block) add_shape(h4) end |
#add_h5(id = nil, **opts, &block) ⇒ Object
115 116 117 118 119 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 115 def add_h5(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id h5 = DrawioDsl::Schema::H5.new(current_page, **opts, &block) add_shape(h5) end |
#add_h6(id = nil, **opts, &block) ⇒ Object
121 122 123 124 125 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 121 def add_h6(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id h6 = DrawioDsl::Schema::H6.new(current_page, **opts, &block) add_shape(h6) end |
#add_hexagon(id = nil, **opts, &block) ⇒ Object
253 254 255 256 257 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 253 def add_hexagon(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id hexagon = DrawioDsl::Schema::Hexagon.new(current_page, **opts, &block) add_shape(hexagon) end |
#add_interface(id = nil, **opts, &block) ⇒ Object
259 260 261 262 263 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 259 def add_interface(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id interface = DrawioDsl::Schema::Interface.new(current_page, **opts, &block) add_shape(interface) end |
#add_klass(id = nil, **opts, &block) ⇒ Object
265 266 267 268 269 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 265 def add_klass(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id klass = DrawioDsl::Schema::Klass.new(current_page, **opts, &block) add_shape(klass) end |
#add_long_dash(id = nil, **opts, &block) ⇒ Object
43 44 45 46 47 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 43 def add_long_dash(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id long_dash = DrawioDsl::Schema::LongDash.new(current_page, **opts, &block) add_shape(long_dash) end |
#add_note(id = nil, **opts, &block) ⇒ Object
271 272 273 274 275 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 271 def add_note(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id note = DrawioDsl::Schema::Note.new(current_page, **opts, &block) add_shape(note) end |
#add_p(id = nil, **opts, &block) ⇒ Object
127 128 129 130 131 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 127 def add_p(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id p = DrawioDsl::Schema::P.new(current_page, **opts, &block) add_shape(p) end |
#add_process(id = nil, **opts, &block) ⇒ Object
277 278 279 280 281 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 277 def add_process(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id process = DrawioDsl::Schema::Process.new(current_page, **opts, &block) add_shape(process) end |
#add_rectangle(id = nil, **opts, &block) ⇒ Object
283 284 285 286 287 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 283 def add_rectangle(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id rectangle = DrawioDsl::Schema::Rectangle.new(current_page, **opts, &block) add_shape(rectangle) end |
#add_rectangle2(id = nil, **opts, &block) ⇒ Object
289 290 291 292 293 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 289 def add_rectangle2(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id rectangle2 = DrawioDsl::Schema::Rectangle2.new(current_page, **opts, &block) add_shape(rectangle2) end |
#add_solid(id = nil, **opts, &block) ⇒ Object
7 8 9 10 11 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 7 def add_solid(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id solid = DrawioDsl::Schema::Solid.new(current_page, **opts, &block) add_shape(solid) end |
#add_square(id = nil, **opts, &block) ⇒ Object
295 296 297 298 299 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 295 def add_square(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id square = DrawioDsl::Schema::Square.new(current_page, **opts, &block) add_shape(square) end |
#add_step(id = nil, **opts, &block) ⇒ Object
301 302 303 304 305 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 301 def add_step(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id step = DrawioDsl::Schema::Step.new(current_page, **opts, &block) add_shape(step) end |
#add_tick(id = nil, **opts, &block) ⇒ Object
307 308 309 310 311 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 307 def add_tick(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id tick = DrawioDsl::Schema::Tick.new(current_page, **opts, &block) add_shape(tick) end |
#add_todo(id = nil, **opts, &block) ⇒ Object
313 314 315 316 317 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 313 def add_todo(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id todo = DrawioDsl::Schema::Todo.new(current_page, **opts, &block) add_shape(todo) end |
#add_triangle(id = nil, **opts, &block) ⇒ Object
325 326 327 328 329 |
# File 'lib/drawio_dsl/dom_builder_shapes.rb', line 325 def add_triangle(id = nil, **opts, &block) opts = { id: id }.merge(opts) if id triangle = DrawioDsl::Schema::Triangle.new(current_page, **opts, &block) add_shape(triangle) end |