Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: do-more

This branch is 7 commits ahead, 361 commits behind datamapper:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

..
Failed to load latest commit information.
lib
spec
tasks
History.txt
LICENSE
Manifest.txt
README.txt
Rakefile
TODO

README.txt

== README

DataMapper::Observer allows you to add callback hooks to many models. This is
similar to observers in ActiveRecord.

Example:

class Adam
  include DataMapper::Resource

  property :id, Integer, :serial => true
  property :name, String
end

class AdamObserver
  include DataMapper::Observer

  observe Adam

  before :save do
    # log message
  end

  before :get_drunk do
    # eat something
  end

  after_class_method :unite do
    raise "Call for help!"
  end

end
Something went wrong with that request. Please try again.