class CFoundry::ChattyHash
Public Class Methods
new(callback, hash = {})
click to toggle source
# File lib/cfoundry/chatty_hash.rb, line 5 def initialize(callback, hash = {}) @callback = callback @hash = hash end
Public Instance Methods
[](name)
click to toggle source
# File lib/cfoundry/chatty_hash.rb, line 10 def [](name) @hash[name] end
[]=(name, value)
click to toggle source
# File lib/cfoundry/chatty_hash.rb, line 14 def []=(name, value) @hash[name] = value @callback.call(self) value end
delete(key)
click to toggle source
# File lib/cfoundry/chatty_hash.rb, line 24 def delete(key) value = @hash.delete(key) @callback.call(self) value end
each(&blk)
click to toggle source
# File lib/cfoundry/chatty_hash.rb, line 20 def each(&blk) @hash.each(&blk) end
inspect()
click to toggle source
# File lib/cfoundry/chatty_hash.rb, line 42 def inspect @hash.inspect end
to_hash()
click to toggle source
# File lib/cfoundry/chatty_hash.rb, line 34 def to_hash @hash end
to_json(*args)
click to toggle source
# File lib/cfoundry/chatty_hash.rb, line 30 def to_json(*args) @hash.to_json(*args) end
to_s()
click to toggle source
# File lib/cfoundry/chatty_hash.rb, line 38 def to_s @hash.to_s end