Class: DrawioDsl::Schema::CommonStyle

Inherits:
Object
  • Object
show all
Defined in:
lib/drawio_dsl/schema/common_style.rb

Overview

Common Style is the reused on Diagram, Page and Shape

When styles are not provided at each level, then they will inherit from the parent common style.

Shapes will use the common style of their page

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args, &block) ⇒ CommonStyle

Returns a new instance of CommonStyle.



19
20
21
22
23
24
25
26
27
28
# File 'lib/drawio_dsl/schema/common_style.rb', line 19

def initialize(**args, &block)
  @white_space      = args[:white_space]
  @html             = args[:html]
  @rounded          = args[:rounded]
  @shadow           = args[:shadow]
  @sketch           = args[:sketch]
  @glass            = args[:glass]

  instance_eval(&block) if block_given?
end

Instance Attribute Details

#glassObject

Returns the value of attribute glass.



16
17
18
# File 'lib/drawio_dsl/schema/common_style.rb', line 16

def glass
  @glass
end

#htmlObject

Returns the value of attribute html.



13
14
15
# File 'lib/drawio_dsl/schema/common_style.rb', line 13

def html
  @html
end

#roundedObject

Returns the value of attribute rounded.



14
15
16
# File 'lib/drawio_dsl/schema/common_style.rb', line 14

def rounded
  @rounded
end

#shadowObject

Returns the value of attribute shadow.



15
16
17
# File 'lib/drawio_dsl/schema/common_style.rb', line 15

def shadow
  @shadow
end

#sketchObject

Returns the value of attribute sketch.



17
18
19
# File 'lib/drawio_dsl/schema/common_style.rb', line 17

def sketch
  @sketch
end

#white_spaceObject

Returns the value of attribute white_space.



12
13
14
# File 'lib/drawio_dsl/schema/common_style.rb', line 12

def white_space
  @white_space
end

Instance Method Details

#to_hObject



30
31
32
33
34
35
36
37
38
39
# File 'lib/drawio_dsl/schema/common_style.rb', line 30

def to_h
  {
    white_space: white_space,
    html: html,
    rounded: rounded,
    shadow: shadow,
    sketch: sketch,
    glass: glass
  }
end