Class: CLI::Colors

Inherits:
Object
  • Object
show all
Defined in:
lib/command_four/cli.rb

Instance Method Summary collapse

Constructor Details

#initializeColors



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_colorObject



82
83
84
# File 'lib/command_four/cli.rb', line 82

def current_color
  @colors[@cur_colors_index]
end

#switch_colorObject



86
87
88
# File 'lib/command_four/cli.rb', line 86

def switch_color
  @cur_colors_index = (@cur_colors_index + 1) % 2
end