Class: ColorPicker

Inherits:
Object
  • Object
show all
Defined in:
lib/smartos-manager/cli.rb

Instance Method Summary collapse

Constructor Details

#initializeColorPicker

Returns a new instance of ColorPicker.



10
11
12
13
# File 'lib/smartos-manager/cli.rb', line 10

def initialize
  @colors = {}
  @available_colors = %w(green yellow cyan magenta blue red gray white)
end

Instance Method Details

#get(str) ⇒ Object



15
16
17
# File 'lib/smartos-manager/cli.rb', line 15

def get(str)
  @colors[str] ||= @available_colors.shift()
end