Class: CLI::Colors
- Inherits:
-
Object
- Object
- CLI::Colors
- Defined in:
- lib/command_four/cli.rb
Instance Method Summary collapse
- #current_color ⇒ Object
-
#initialize ⇒ Colors
constructor
A new instance of Colors.
- #switch_color ⇒ Object
Constructor Details
#initialize ⇒ Colors
77 78 79 80 |
# File 'lib/command_four/cli.rb', line 77 def initialize @colors = [:red, :yellow] @cur_colors_index = 0 end |
Instance Method Details
#current_color ⇒ Object
82 83 84 |
# File 'lib/command_four/cli.rb', line 82 def current_color @colors[@cur_colors_index] end |
#switch_color ⇒ Object
86 87 88 |
# File 'lib/command_four/cli.rb', line 86 def switch_color @cur_colors_index = (@cur_colors_index + 1) % 2 end |