Sha256: fc80c96b5fc7755f74facf018480449baddb2c7fb96245121a3c2a864242b965
Contents?: true
Size: 637 Bytes
Versions: 158
Compression:
Stored size: 637 Bytes
Contents
module CFoundry class ChattyHash include Enumerable def initialize(callback, hash = {}) @callback = callback @hash = hash end def [](name) @hash[name] end def []=(name, value) @hash[name] = value @callback.call(self) value end def each(&blk) @hash.each(&blk) end def delete(key) value = @hash.delete(key) @callback.call(self) value end def to_json(*args) @hash.to_json(*args) end def to_hash @hash end def to_s @hash.to_s end def inspect @hash.inspect end end end
Version data entries
158 entries across 158 versions & 5 rubygems