class String
Public Instance Methods
capitalize_first()
click to toggle source
Capitalize the first letter without changing the rest of the string. (String#capitalize makes the rest of the string lower-case.)
@return [String] The capitalized text
# File lib/gamefic/core_ext/string.rb, line 8 def capitalize_first "#{self[0, 1].upcase}#{self[1, self.length]}" end
Also aliased as: cap_first
split_words()
click to toggle source
Get an array of words split by any whitespace.
@return [Array]
# File lib/gamefic/core_ext/string.rb, line 16 def split_words self.gsub(/[\s]+/, ' ').strip.split end
to_serial(_index = [])
click to toggle source
# File lib/gamefic/serialize.rb, line 149 def to_serial(_index = []) self end