Class: DrawioDsl::Schema::DefaultPalette

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

Overview

Default Palette contains palette information that can be inherited at each level

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner, **args, &block) ⇒ DefaultPalette

Returns a new instance of DefaultPalette.



12
13
14
15
16
17
18
19
# File 'lib/drawio_dsl/schema/default_palette.rb', line 12

def initialize(owner, **args, &block)
  @fill_color   = args[:fill_color]
  @stroke_color = args[:stroke_color]
  @font_color   = args[:font_color]
  @gradient     = args[:gradient]

  instance_exec(owner, &block) if block_given?
end

Instance Attribute Details

#fill_colorObject

Returns the value of attribute fill_color.



7
8
9
# File 'lib/drawio_dsl/schema/default_palette.rb', line 7

def fill_color
  @fill_color
end

#font_colorObject

Returns the value of attribute font_color.



9
10
11
# File 'lib/drawio_dsl/schema/default_palette.rb', line 9

def font_color
  @font_color
end

#gradientObject

Returns the value of attribute gradient.



10
11
12
# File 'lib/drawio_dsl/schema/default_palette.rb', line 10

def gradient
  @gradient
end

#stroke_colorObject

Returns the value of attribute stroke_color.



8
9
10
# File 'lib/drawio_dsl/schema/default_palette.rb', line 8

def stroke_color
  @stroke_color
end

Instance Method Details

#to_hObject



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

def to_h
  {
    fill_color: fill_color,
    stroke_color: stroke_color,
    font_color: font_color,
    gradient: gradient
  }
end