Module | Gibbler::Object |
In: |
lib/gibbler.rb
lib/gibbler/aliases.rb |
A simple override on Object#freeze to create a digest before the object is frozen. Once the object is frozen obj.gibbler will return the cached value with out calculation.
Calculates a digest for the current object instance. Objects that are a kind of Hash or Array are processed recursively. The length of the returned String depends on the digest type. Also stores the value in the attic.
obj.gibbler # => a5b1191a obj.gibbler_cache # => a5b1191a
Calling gibbler_cache returns the most recent digest without calculation.
If the object is frozen, this will return the value of gibbler_cache.