Class: String

Inherits:
Object show all
Defined in:
lib/core_ext/string.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/core_ext/string.rb', line 8

def blank?
  self == ""
end

#titleizeObject



2
3
4
5
6
# File 'lib/core_ext/string.rb', line 2

def titleize
  self.split(" ").reduce("") { |phrase,token|
    phrase += token[0].upcase + token[1..-1] + " "
  }.strip
end