Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/buildizer/core_ext/string.rb
Instance Method Summary collapse
Instance Method Details
#match_glob?(glob) ⇒ Boolean
6 7 8 |
# File 'lib/buildizer/core_ext/string.rb', line 6 def match_glob?(glob) File.fnmatch? glob, self, File::FNM_EXTGLOB end |
#off? ⇒ Boolean
14 15 16 |
# File 'lib/buildizer/core_ext/string.rb', line 14 def off? !on? end |
#on? ⇒ Boolean
10 11 12 |
# File 'lib/buildizer/core_ext/string.rb', line 10 def on? ['1', 'true', 'yes'].include? self.downcase end |
#underscore ⇒ Object
2 3 4 |
# File 'lib/buildizer/core_ext/string.rb', line 2 def underscore self.gsub(/(.)([A-Z])/,'\1_\2').downcase end |