Class: EacCli::Enum
- Defined in:
- lib/eac_cli/enum.rb
Overview
A [EacRubyUtils::Enum] which each value is associated with one console color.
Constant Summary collapse
- TO_BG_LABEL_FG_COLOR =
Foreground color used in [to_bg_label]
:light_white
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
Instance Method Summary collapse
-
#initialize(key, color) ⇒ Enum
constructor
A new instance of Enum.
- #to_bg_label ⇒ String
- #to_fg_label ⇒ String
- #to_label ⇒ String
Constructor Details
#initialize(key, color) ⇒ Enum
Returns a new instance of Enum.
14 15 16 17 |
# File 'lib/eac_cli/enum.rb', line 14 def initialize(key, color) super(key) @color = color end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
12 13 14 |
# File 'lib/eac_cli/enum.rb', line 12 def color @color end |
Instance Method Details
#to_bg_label ⇒ String
32 33 34 |
# File 'lib/eac_cli/enum.rb', line 32 def to_bg_label to_fg_bg_label(TO_BG_LABEL_FG_COLOR, color) end |
#to_fg_label ⇒ String
27 28 29 |
# File 'lib/eac_cli/enum.rb', line 27 def to_fg_label to_fg_bg_label(color) end |
#to_label ⇒ String
22 23 24 |
# File 'lib/eac_cli/enum.rb', line 22 def to_label to_fg_label end |