class Sungemm::HashWithIndifferentAccess

Public Class Methods

[](*args) click to toggle source
# File lib/sungemm/hash.rb, line 12
def self.[](*args)
  new(args)
end
new(args = []) click to toggle source
# File lib/sungemm/hash.rb, line 3
def initialize(args = [])
  @hash = {}
  args.each_slice(2) do |x|
    k = x[0].to_sym
    v = x[1].nil? ? nil : x[1]
    @hash[k] = v
  end
end

Public Instance Methods

[](key) click to toggle source
# File lib/sungemm/hash.rb, line 20
def [](key)
  @hash[key.to_sym]
end
[]=(key, value) click to toggle source
# File lib/sungemm/hash.rb, line 16
def []=(key, value)
  @hash[key.to_sym] = value
end