Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/globals.rb
Overview
Extend String For Our Evil Purposes
Instance Method Summary collapse
- #err ⇒ Object
- #indent ⇒ Object
- #numeric? ⇒ Boolean
- #success ⇒ Object
- #validate?(regex) ⇒ Boolean
- #warn ⇒ Object
Instance Method Details
#err ⇒ Object
79 80 81 82 |
# File 'lib/globals.rb', line 79 def err c = " ERROR ".red + self if $isWindows then c.bold else c end end |
#indent ⇒ Object
92 93 94 |
# File 'lib/globals.rb', line 92 def indent " " + self end |
#numeric? ⇒ Boolean
44 45 46 |
# File 'lib/globals.rb', line 44 def numeric? Float(self) != nil rescue false end |
#success ⇒ Object
88 89 90 |
# File 'lib/globals.rb', line 88 def success " SUCCESS ".green + self end |
#validate?(regex) ⇒ Boolean
48 49 50 |
# File 'lib/globals.rb', line 48 def validate? regex !self[regex].nil? end |
#warn ⇒ Object
84 85 86 |
# File 'lib/globals.rb', line 84 def warn " WARNING ".yellow + self end |