Module: Puree::Util::String
- Defined in:
- lib/puree/util/string.rb
Overview
String utilities.
Class Method Summary collapse
-
.titleize(x) ⇒ Object
Titleize Assumes underscore as separator.
Class Method Details
.titleize(x) ⇒ Object
Titleize Assumes underscore as separator. e.g. foo_bar becomes FooBar
11 12 13 14 15 |
# File 'lib/puree/util/string.rb', line 11 def self.titleize(x) arr = "#{x}".split('_') caps = arr.map { |i| i.capitalize } caps.join end |