Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/arkana/helpers/string.rb
Overview
String extensions and utilities.
Instance Method Summary collapse
-
#camel_case ⇒ Object
Returns a string converted from an assumed PascalCase, to camelCase.
-
#capitalize_first_letter ⇒ Object
Returns a string with its first character capitalized.
Instance Method Details
#camel_case ⇒ Object
Returns a string converted from an assumed PascalCase, to camelCase.
6 7 8 9 10 11 12 |
# File 'lib/arkana/helpers/string.rb', line 6 def camel_case return self if empty? copy = dup copy[0] = copy[0].downcase copy end |
#capitalize_first_letter ⇒ Object
Returns a string with its first character capitalized.
15 16 17 18 19 20 21 |
# File 'lib/arkana/helpers/string.rb', line 15 def capitalize_first_letter return self if empty? copy = dup copy[0] = copy[0].upcase copy end |