Sha256: 6273324a9e75f24f008bc3f1958ac742464eadfc9c23d949d6f9b5ad3716654a

Contents?: true

Size: 486 Bytes

Versions: 4

Compression:

Stored size: 486 Bytes

Contents

# frozen_string_literal: true

module DrawioDsl
  # DrawioDsl::Shapes is a list of DSL methods (one per shape)
  # :nocov:
  module DrawioShapes
    def random(**opts)
      case rand({{shape_length}})
      {{#each shapes}}
      when {{@index}}
        {{snake ./type}}(**opts)
      {{/each}}
      end
    end
    {{#each shapes}}

    def {{snake ./type}}(id = nil, **opts, &block)
      builder.add_{{snake ./type}}(id, **opts, &block)
    end
    {{/each}}
  end
  # :nocov:
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
drawio_dsl-0.8.4 .builders/.templates/basic/drawio_shapes.rb
drawio_dsl-0.8.3 .builders/.templates/basic/drawio_shapes.rb
drawio_dsl-0.8.2 .builders/.templates/basic/drawio_shapes.rb
drawio_dsl-0.8.1 .builders/.templates/basic/drawio_shapes.rb