Class: Sickill::Rainbow::AnsiColor

Inherits:
Object
  • Object
show all
Defined in:
lib/glark/util/highlight.rb

Instance Method Summary collapse

Instance Method Details

#validate_color_nameObject

includes the aberrant color name in the error message.



21
22
23
24
25
26
27
# File 'lib/glark/util/highlight.rb', line 21

def validate_color_name #:nodoc:
  color_names = TERM_COLORS.keys

  unless color_names.include?(@color)
    raise ArgumentError.new "Unknown color name: '#{@color}'; valid names: #{color_names.join(', ')}"
  end
end