Class: String
Overview
Add String methods camelize
and present?
to String
if activesupport cannot be loaded.
Instance Method Summary collapse
-
#camelize ⇒ Object
paraphrased from activesupport.
- #present? ⇒ Boolean
Instance Method Details
#camelize ⇒ Object
paraphrased from activesupport
9 10 11 |
# File 'lib/mobility/core_ext/string.rb', line 9 def camelize sub(/^[a-z\d]*/) { $&.capitalize }.gsub(/(?:_|(\/))([a-z\d]*)/) { "#{$1}#{$2.capitalize}" }.gsub('/', '::') end |
#present? ⇒ Boolean
13 14 15 |
# File 'lib/mobility/core_ext/string.rb', line 13 def present? !blank? end |