Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/arkana/helpers/string.rb

Overview

String extensions and utilities.

Instance Method Summary collapse

Instance Method Details

#camel_caseObject

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_letterObject

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