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.



13
14
15
16
# File 'lib/eac_cli/enum.rb', line 13

def initialize(key, color)
  super(key)
  @color = color
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



11
12
13
# File 'lib/eac_cli/enum.rb', line 11

def color
  @color
end

Instance Method Details

#to_bg_labelString

Returns:

  • (String)


31
32
33
# File 'lib/eac_cli/enum.rb', line 31

def to_bg_label
  to_fg_bg_label(TO_BG_LABEL_FG_COLOR, color)
end

#to_fg_labelString

Returns:

  • (String)


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

def to_fg_label
  to_fg_bg_label(color)
end

#to_labelString

Returns:

  • (String)


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

def to_label
  to_fg_label
end