Class: Saxxy::Helpers

Inherits:
Object
  • Object
show all
Defined in:
lib/saxxy/utils/helpers.rb

Class Method Summary collapse

Class Method Details

.camelize(obj) ⇒ Object


4
5
6
# File 'lib/saxxy/utils/helpers.rb', line 4

def self.camelize(obj)
  obj.to_s.split(/[^a-z0-9]/i).map(&:capitalize).join
end

.stringify_keys(hash) ⇒ Object


8
9
10
# File 'lib/saxxy/utils/helpers.rb', line 8

def self.stringify_keys(hash)
  Hash[hash.map { |k, v| [k.to_s, v] }]
end