Class: IB::Datatypes::StringentHash
- Inherits:
-
Hash
- Object
- Hash
- IB::Datatypes::StringentHash
- Defined in:
- lib/ib-ruby/datatypes.rb
Overview
Just like a Hash, but throws an exception if you try to access a key that doesn’t exist.
Instance Method Summary collapse
-
#initialize(hash) ⇒ StringentHash
constructor
A new instance of StringentHash.
Constructor Details
#initialize(hash) ⇒ StringentHash
Returns a new instance of StringentHash.
392 393 394 395 |
# File 'lib/ib-ruby/datatypes.rb', line 392 def initialize(hash) super() {|hash,key| raise Exception.new("key #{key.inspect} not found!") } self.merge!(hash) unless hash.nil? end |