Sha256: c33c413b587a56cb928424a9754e06a826f452179d4c8f173559a206869f2f39

Contents?: true

Size: 881 Bytes

Versions: 9

Compression:

Stored size: 881 Bytes

Contents

# frozen_string_literal: true

# Attach configuration to the DrawIO DSL module
# :nocov:
module DrawioDsl
  # Used to attach configuration to KConfig module
  module ConfigurationShapes
    ShapeDefaults   = Struct.new(:type, :text_only, :x, :y, :w, :h, :style_modifiers, keyword_init: true)
    Shapes = Struct.new(
      :shape,
      {{#each shapes}}
      :{{snake ./type}},
      {{/each}}
      keyword_init: true
    )

    def add_shapes
      @shapes = Shapes.new(
        shape: ShapeDefaults.new(type: :shape, text_only: false, x: 0, y: 0, w: 20, h: 20, style_modifiers: ''),
        {{#each shapes}}
        {{snake ./type}}: ShapeDefaults.new(type: :{{snake ./type}}, x: {{./x}}, text_only: {{./text_only}}, y: {{./y}}, w: {{./w}}, h: {{./h}}, style_modifiers: '{{{./style_modifiers}}}'){{#if @last}}{{^}},{{/if}}
        {{/each}}
      )
    end
  end
end
# :nocov:

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
drawio_dsl-0.8.1 .builders/.templates/basic/configuration_shapes.rb
drawio_dsl-0.8.0 .builders/.templates/basic/configuration_shapes.rb
drawio_dsl-0.7.0 .builders/.templates/basic/configuration_shapes.rb
drawio_dsl-0.6.0 .builders/.templates/basic/configuration_shapes.rb
drawio_dsl-0.5.7 .builders/.templates/basic/configuration_shapes.rb
drawio_dsl-0.5.6 .builders/.templates/basic/configuration_shapes.rb
drawio_dsl-0.5.5 .builders/.templates/basic/configuration_shapes.rb
drawio_dsl-0.5.4 .builders/.templates/basic/configuration_shapes.rb
drawio_dsl-0.5.3 .builders/.templates/basic/configuration_shapes.rb