Sha256: 310759f3e6980ee1f87d519207cd5853d801a07f6d365f76d274c3ebea2303b5

Contents?: true

Size: 803 Bytes

Versions: 6

Compression:

Stored size: 803 Bytes

Contents

module Unbreakable
  module Observers
    # Abstract class for observers following the Ruby
    # {http://ruby-doc.org/stdlib/libdoc/observer/rdoc/index.html stdlib}
    # implementation of the _Observer_ object-oriented design pattern. See
    # {Unbreakable::Observers::Log} for an example.
    #
    # The following instance methods must be implemented in sub-classes:
    #
    # * +update+
    class Observer
      attr_reader :observed

      # @param observed the observed object
      def initialize(observed)
        @observed = observed
      end

      # @param [Symbol] method the method called on the observed object
      # @param [Array] args the arguments to the method
      # @return [void]
      def update(method, *args)
        raise NotImplementedError
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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