Module: Utilise::Augment::Modify

Included in:
String, Symbol
Defined in:
lib/utilise/augment/modify.rb

Overview

Extends classes that could be modified

Instance Method Summary collapse

Instance Method Details

#camelObject

Return a string in modified camel case



6
7
8
9
# File 'lib/utilise/augment/modify.rb', line 6

def camel
  array = split_up
  array.first + array[1..-1].map(&:capitalize).join('')
end

#snakeObject

Return a string in snake case



12
13
14
# File 'lib/utilise/augment/modify.rb', line 12

def snake
  split_up.join('_')
end

#spaceObject

Return a string in regular space case



17
18
19
# File 'lib/utilise/augment/modify.rb', line 17

def space
  split_up.join(' ')
end