Sha256: 1948668375d7126cdbde929fdb2a5cef39e2dd6bcb80e11eba68eda32e11c3d1
Contents?: true
Size: 657 Bytes
Versions: 11
Compression:
Stored size: 657 Bytes
Contents
module Gitolite # Very simple proxy object for checking if the proxied object was modified # since the last clean_up! method called. It works correctly only for objects # with proper hash method! class DirtyProxy < BasicObject def initialize(target) @target = target clean_up! end def method_missing(method, *args, &block) @target.send(method, *args, &block) end def respond_to?(symbol, include_private=false) super || [:dirty?, :clean_up!].include?(symbol.to_sym) end def dirty? @clean_hash != @target.hash end def clean_up! @clean_hash = @target.hash end end end
Version data entries
11 entries across 11 versions & 1 rubygems