Sha256: 473aedaadc6de1b586a5ede6402c4a1604beaa9c20b64911c76b0d5d69ec57a3

Contents?: true

Size: 463 Bytes

Versions: 17

Compression:

Stored size: 463 Bytes

Contents

== 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, Serial
  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

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
ardm-observer-1.2.0 README.rdoc
dm-observer-1.2.0 README.rdoc
dm-observer-1.2.0.rc2 README.rdoc
dm-observer-1.2.0.rc1 README.rdoc
dm-observer-1.1.0 README.rdoc
dm-observer-1.1.0.rc3 README.rdoc
dm-observer-1.1.0.rc2 README.rdoc
dm-observer-1.1.0.rc1 README.rdoc
dm-observer-1.0.2 README.rdoc
dm-observer-1.0.1 README.rdoc
dm-observer-1.0.0 README.rdoc
dm-observer-1.0.0.rc3 README.rdoc
dm-observer-1.0.0.rc2 README.rdoc
dm-observer-1.0.0.rc1 README.rdoc
dm-observer-0.10.2 README.rdoc
dm-observer-0.10.1 README.rdoc
dm-observer-0.10.0 README.rdoc