Module: DataMapper::Observer::ClassMethods

### Home Classes Methods

### In Files

- lib/dm-observer/observer.rb

### Methods

- ::new
- #after
- #after_class_method
- #before
- #before_class_method
- #observe

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- DataMapper
- DataMapper::Observer
- DataMapper::Observer::ClassMethods

No matching classes.

# DataMapper::Observer::ClassMethods

### Attributes

observing[RW]

### Public Class Methods

new() click to toggle source

    # File lib/dm-observer/observer.rb, line 17
    def initialize
      self.observing = []
    end

### Public Instance Methods

after(sym, &block) click to toggle source

    # File lib/dm-observer/observer.rb, line 33
    def after(sym, &block)
      self.observing.each do |klass|
        klass.after(sym.to_sym, &block)
      end
    end

after_class_method(sym, &block) click to toggle source

    # File lib/dm-observer/observer.rb, line 45
    def after_class_method(sym, &block)
      self.observing.each do |klass|
        klass.after_class_method(sym.to_sym, &block)
      end
    end

before(sym, &block) click to toggle source

    # File lib/dm-observer/observer.rb, line 27
    def before(sym, &block)
      self.observing.each do |klass|
        klass.before(sym.to_sym, &block)
      end
    end

before_class_method(sym, &block) click to toggle source

    # File lib/dm-observer/observer.rb, line 39
    def before_class_method(sym, &block)
      self.observing.each do |klass|
        klass.before_class_method(sym.to_sym, &block)
      end
    end

observe(*args) click to toggle source

Assign an Array of Class names to watch.

    observe User, Article, Topic

    # File lib/dm-observer/observer.rb, line 23
    def observe(*args)
      self.observing = args
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.