Sha256: f0b69f8f1f4cc8e721970a5e46b4f6b86080669bc93ffb6167c7fc2fe9d9b013

Contents?: true

Size: 445 Bytes

Versions: 21

Compression:

Stored size: 445 Bytes

Contents

class Knj::Hash_methods < Hash
  def initialize(hash = {})
    self.update(hash)
  end
  
  def db
    return self[:db]
  end
  
  def ob
    return self[:ob]
  end
  
  def args
    return self[:args]
  end
  
  def data
    return self[:data]
  end
  
  def method_missing(method, *args)
    method = method.to_sym
    return self[method] if self.key?(method)
    
    raise "No such method '#{method}' on class '#{self.class.name}'"
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
knjrbfw-0.0.9 lib/knj/hash_methods.rb