Parent

Class/Module Index [+]

Quicksearch

Hash

Public Instance Methods

symbolize_keys() click to toggle source

Returns self with all keys symbolized.

# File lib/stomp/ext/hash.rb, line 21
def symbolize_keys
  symbolized = {}
  self.each_pair do |key, value|
    symbolized[key.to_sym] = value
  end

  symbolized
end
uncamelize_and_stringify_keys() click to toggle source

Returns self with keys uncamelized and converted to strings.

# File lib/stomp/ext/hash.rb, line 10
def uncamelize_and_stringify_keys
  uncamelized = {}
  self.each_pair do |key, value|
    new_key = key.to_s.split(/(?=[A-Z])/).join('_').downcase
    uncamelized[new_key] = value
  end

  uncamelized
end
uncamelize_and_symbolize_keys() click to toggle source

Returns self with keys uncamelized and converted to symbols.

# File lib/stomp/ext/hash.rb, line 5
def uncamelize_and_symbolize_keys
  self.uncamelize_and_stringify_keys.symbolize_keys
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.