Class: Lutaml::Xsd::Spa::Svg::Config::IndicatorColors

Inherits:
Object
  • Object
show all
Defined in:
lib/lutaml/xsd/spa/svg/config/color_scheme.rb

Overview

Indicator color value object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(colors_hash) ⇒ IndicatorColors

Returns a new instance of IndicatorColors.



66
67
68
69
70
# File 'lib/lutaml/xsd/spa/svg/config/color_scheme.rb', line 66

def initialize(colors_hash)
  @required = colors_hash["required"]
  @optional = colors_hash["optional"]
  @abstract = colors_hash["abstract"]
end

Instance Attribute Details

#abstractObject (readonly)

Returns the value of attribute abstract.



64
65
66
# File 'lib/lutaml/xsd/spa/svg/config/color_scheme.rb', line 64

def abstract
  @abstract
end

#optionalObject (readonly)

Returns the value of attribute optional.



64
65
66
# File 'lib/lutaml/xsd/spa/svg/config/color_scheme.rb', line 64

def optional
  @optional
end

#requiredObject (readonly)

Returns the value of attribute required.



64
65
66
# File 'lib/lutaml/xsd/spa/svg/config/color_scheme.rb', line 64

def required
  @required
end

Instance Method Details

#color_for(type) ⇒ Object



72
73
74
75
76
77
78
# File 'lib/lutaml/xsd/spa/svg/config/color_scheme.rb', line 72

def color_for(type)
  case type.to_sym
  when :required then @required
  when :optional then @optional
  when :abstract then @abstract
  end
end