Class: Frozen::Hash

Inherits:
Hash
  • Object
show all
Defined in:
lib/frozen-objects/hash.rb

Overview

Note:

All calls are Hash compatible.

Implicitly frozen Hash.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args, &block) ⇒ Hash

Returns a new instance of Hash.



22
23
24
25
# File 'lib/frozen-objects/hash.rb', line 22

def initialize(*args, &block)
    super(*args, &block)
    self.freeze
end

Class Method Details

.[](*args) ⇒ Object



17
18
19
20
# File 'lib/frozen-objects/hash.rb', line 17

def self.[](*args)
    result = super(*args)
    result.freeze
end