Class Hash
In: lib/webby/core_ext/hash.rb
Parent: Object

Methods

Public Instance methods

[Source]

# File lib/webby/core_ext/hash.rb, line 4
  def sanitize!
    h = self.injecting({}) do |h, (k, v)|
          h[k] = case v
                 when 'none', 'nil'; nil
                 when 'true', 'yes'; true
                 when 'false', 'no'; false
                 else v end
        end
    self.replace h
  end

[Source]

# File lib/webby/core_ext/hash.rb, line 15
  def stringify_keys
    h = {}
    self.each {|k,v| h[k.to_s] = v}
    return h
  end

[Source]

# File lib/webby/core_ext/hash.rb, line 21
  def symbolize_keys
    h = {}
    self.each {|k,v| h[k.to_sym] = v}
    return h
  end

[Validate]