class Isolator::SimpleHashie

Hash with key accessors

Public Instance Methods

method_missing(key, *args, &block) click to toggle source
Calls superclass method
# File lib/isolator/simple_hashie.rb, line 6
def method_missing(key, *args, &block)
  key_str = key.to_s

  if key_str.end_with?("=")
    self[key_str.tr("=")] = args.first
  else
    fetch(key_str) { super }
  end
end
respond_to_missing?(key) click to toggle source
Calls superclass method
# File lib/isolator/simple_hashie.rb, line 16
def respond_to_missing?(key)
  key_str = key.to_s
  if key_str.end_with?("=")
    key?(key_str.tr("=")) || super
  else
    key?(key_str) || super
  end
end