Class: ColorPicker
- Inherits:
-
Object
- Object
- ColorPicker
- Defined in:
- lib/smartos-manager/cli.rb
Instance Method Summary collapse
- #get(str) ⇒ Object
-
#initialize ⇒ ColorPicker
constructor
A new instance of ColorPicker.
Constructor Details
#initialize ⇒ ColorPicker
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 |