Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/titleize.rb

Instance Method Summary collapse

Instance Method Details

#titleizeObject Also known as: titlecase

Capitalizes most words to create a nicer looking title string.

The list of “small words” which are not capped comes from the New York Times Manual of Style, plus ‘vs’ and ‘v’.

titleize is also aliased as titlecase.

"notes on a scandal" # => "Notes on a Scandal"
"the good german"    # => "The Good German"


85
86
87
88
89
90
91
# File 'lib/titleize.rb', line 85

def titleize
  if defined? ActiveSupport
    ActiveSupport::Inflector.titleize(self)
  else
    Titleize.titleize(self)
  end
end