Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/core_ext/string.rb
Overview
Archetype extensions for String
Instance Method Summary collapse
-
#camel_case ⇒ String
Converts a string to camel case.
-
#dash_case ⇒ String
Converts string to dash case.
-
#pluralize ⇒ String
Attempts to pluralize a word.
-
#randomize(size = 5) ⇒ String
Adds a random string of specified length at the end.
-
#singularize ⇒ String
Attempts to singluarize a word.
-
#snake_case ⇒ String
Converts string to snake case.
Instance Method Details
#camel_case ⇒ String
Converts a string to camel case
28 29 30 |
# File 'lib/core_ext/string.rb', line 28 def camel_case helper.camel_case(self) end |
#dash_case ⇒ String
Converts string to dash case
19 20 21 |
# File 'lib/core_ext/string.rb', line 19 def dash_case helper.dash_case(self) end |
#pluralize ⇒ String
Attempts to pluralize a word
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
55 56 57 |
# File 'lib/core_ext/string.rb', line 55 def randomize(size = 5) helper.randomize(self, size.to_s) end |
#singularize ⇒ String
Attempts to singluarize a word
46 47 48 |
# File 'lib/core_ext/string.rb', line 46 def singularize helper.singularize(self) end |
#snake_case ⇒ String
Converts string to snake case
10 11 12 |
# File 'lib/core_ext/string.rb', line 10 def snake_case helper.snake_case(self) end |