Sha256: 27767e9734dc2a3b79c90398d92fc1bd7d955d64365e57f8134638da27bb0131
Contents?: true
Size: 553 Bytes
Versions: 32
Compression:
Stored size: 553 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 end end
Version data entries
32 entries across 32 versions & 2 rubygems