class CLI::Colors
Public Class Methods
new()
click to toggle source
# File lib/command_four/cli.rb, line 77 def initialize @colors = [:red, :yellow] @cur_colors_index = 0 end
Public Instance Methods
current_color()
click to toggle source
# File lib/command_four/cli.rb, line 82 def current_color @colors[@cur_colors_index] end
switch_color()
click to toggle source
# File lib/command_four/cli.rb, line 86 def switch_color @cur_colors_index = (@cur_colors_index + 1) % 2 end