Module: StringExt
- Defined in:
- lib/vendor/string_ext.rb
Instance Method Summary collapse
Instance Method Details
#blank? ⇒ Boolean
12 13 14 |
# File 'lib/vendor/string_ext.rb', line 12 def blank? empty? || strip.empty? end |
#classify ⇒ Object
3 4 5 |
# File 'lib/vendor/string_ext.rb', line 3 def classify split('/').map { |c| c.split('_').map(&:capitalize).join }.join('::') end |
#constantize ⇒ Object
7 8 9 |
# File 'lib/vendor/string_ext.rb', line 7 def constantize self.split("::").inject(Module) {|acc, val| acc.const_get(val)} end |