Class: String

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

Overview

Archetype extensions for String

Instance Method Summary collapse

Instance Method Details

#camel_caseString

Converts a string to camel case

Returns:



28
29
30
# File 'lib/core_ext/string.rb', line 28

def camel_case
  helper.camel_case(self)
end

#dash_caseString

Converts string to dash case

Returns:



19
20
21
# File 'lib/core_ext/string.rb', line 19

def dash_case
  helper.dash_case(self)
end

#pluralizeString

Attempts to pluralize a word

Returns:



37
38
39
# File 'lib/core_ext/string.rb', line 37

def pluralize
  helper.pluralize(self)
end

#randomize(size = 5) ⇒ String

Adds a random string of specified length at the end

Returns:



55
56
57
# File 'lib/core_ext/string.rb', line 55

def randomize(size = 5)
  helper.randomize(self, size.to_s)
end

#singularizeString

Attempts to singluarize a word

Returns:



46
47
48
# File 'lib/core_ext/string.rb', line 46

def singularize
  helper.singularize(self)
end

#snake_caseString

Converts string to snake case

Returns:



10
11
12
# File 'lib/core_ext/string.rb', line 10

def snake_case
  helper.snake_case(self)
end