Method: Planter::Color#support?

Defined in:
lib/planter/color.rb

#support?(feature) ⇒ Boolean

Returns true if Color supports the +feature+.

The feature :clear, that is mixing the clear color attribute into String, is only supported on ruby implementations, that do not already implement the String#clear method. It's better to use the reset color attribute instead.

Returns:

  • (Boolean)


93
94
95
96
97
98
# File 'lib/planter/color.rb', line 93

def support?(feature)
  case feature
  when :clear
    !String.instance_methods(false).map(&:to_sym).include?(:clear)
  end
end