Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/greenhat/color.rb,
lib/greenhat/thing/helpers.rb
Overview
Pretty sure this is a bad idea to patch string. mentalized.net/journal/2011/04/14/ruby-how-to-check-if-a-string-is-numeric/
Instance Method Summary collapse
Instance Method Details
#numeric? ⇒ Boolean
34 35 36 37 38 |
# File 'lib/greenhat/thing/helpers.rb', line 34 def numeric? !Float(self).nil? rescue StandardError false end |
#pastel(*args) ⇒ Object
20 21 22 |
# File 'lib/greenhat/color.rb', line 20 def pastel(*args) GreenHat::Color.decorate(args.unshift(self)) end |
#unpastel ⇒ Object
24 25 26 |
# File 'lib/greenhat/color.rb', line 24 def unpastel GreenHat::Color.pastel.strip self end |