0.02
Repository is archived
No commit activity in last 3 years
No release in over 3 years
DataMapper plugin for observing Resources
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6.4
~> 0.9.2
~> 1.3.2

Runtime

~> 1.2.0
 Project Readme

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