Sha256: 38915e379ea6040c42f40a79fb9e1fc4c0d87e269c8c51157a40c6fbd23c44f9
Contents?: true
Size: 516 Bytes
Versions: 38
Compression:
Stored size: 516 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 end end
Version data entries
38 entries across 38 versions & 2 rubygems