Class: EacCli::Enum

Inherits:
EacRubyUtils::Enum
  • Object
show all
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

Instance Method Summary collapse

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

#colorObject (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_labelString

Returns:

  • (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_labelString

Returns:

  • (String)


27
28
29
# File 'lib/eac_cli/enum.rb', line 27

def to_fg_label
  to_fg_bg_label(color)
end

#to_labelString

Returns:

  • (String)


22
23
24
# File 'lib/eac_cli/enum.rb', line 22

def to_label
  to_fg_label
end