Module: SimpleSymbolize::CoreExt::String

Defined in:
lib/simple_symbolize/core_ext/string/symbolize.rb

Overview

Contains methods to be mixed into the String class

Instance Method Summary collapse

Instance Method Details

#simple_camelizeObject

Examples:

Turns a String into a camelCase Symbol

"Hello World".simple_camelize => :helloWorld


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

def simple_camelize
  SimpleSymbolize.camelize(self)
end

#simple_elementizeObject

Examples:

Symbolizes a String then calls #to_s

"helloWorld".simple_elementize => 'hello_word'


25
26
27
# File 'lib/simple_symbolize/core_ext/string/symbolize.rb', line 25

def simple_elementize
  SimpleSymbolize.elementize(self)
end

#simple_snakeizeObject

Examples:

Turns a String into it’s snake_case equivalent

"helloWorld".simple_snakeize => 'hello_word'


31
32
33
# File 'lib/simple_symbolize/core_ext/string/symbolize.rb', line 31

def simple_snakeize
  SimpleSymbolize.snakeize(self)
end

#simple_symbolizeObject

Examples:

Symbolize a string using the String object method

"hello world!".symbolize #=> :hello_world


13
14
15
# File 'lib/simple_symbolize/core_ext/string/symbolize.rb', line 13

def simple_symbolize
  SimpleSymbolize.symbolize(self)
end