Event::Object
EventObject - event-driven programming for ruby
Installation
Add this line to your application's Gemfile:
gem 'event-object'
And then execute:
$ bundle
Or install it yourself as:
$ gem install event-object
Usage
using EventObject
class EventEmitter
events :success, :error
end
emitter = EventEmitter.new
emitter.on :success do
[200, {}, "OK"]
end
p emitter.success!
Contributing
- Fork it ( https://github.com/[my-github-username]/event-object/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request