No Backsies
DESCRIPTION
NoBackies is a callback layer built on top of Ruby’s built-in callback methods. It makes it possible to add new callbacks very easily, without having to fuss with more nuanced issues of defining and redefining callback methods.
RESOURCES
EXAMPLE
Here is an example take from the Anise project.
class Y
include Anise
include NoBacksies
def self.doc(string)
callback :method_added, :once=>true do |method|
self.ann(method, :doc=>string)
end
end
doc "foo is cool"
def foo
# ...
end
end
Y.ann(:foo, :doc) #=> "foo is cool"
See the QED documentation for more examples.
INSTALLATION
Install the RubyGems package in the usual fashion.
$ gem install no_backsies
LEGAL
(Apache 2.0 License)
Copyright © 2011 Thomas Sawyer
Unless otherwise negotiated with the original author, NoBacksies is distributable under the terms of the Apache 2.0 license. See the APACHE2.txt file for details.