Sha256: 46c625935531f849443735278228cc6c434d821948612d1a57c6533832b32863

Contents?: true

Size: 495 Bytes

Versions: 6

Compression:

Stored size: 495 Bytes

Contents

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
unbreakable-0.0.6 lib/unbreakable/observers/log.rb
unbreakable-0.0.5 lib/unbreakable/observers/log.rb
unbreakable-0.0.4 lib/unbreakable/observers/log.rb
unbreakable-0.0.3 lib/unbreakable/observers/log.rb
unbreakable-0.0.2 lib/unbreakable/observers/log.rb
unbreakable-0.0.1 lib/unbreakable/observers/log.rb