module Unbreakable module Observers # Logs debug messages when files are stored or skipped if the observed # object has a +#log+ method. class Log < Observer # (see Observer#update) def update(method, *args) if observed.respond_to? :log case method when :store observed.log.debug "Store #{args.first}" when :skip observed.log.debug "Skip #{args.first}" end end end end end end