README.md in emittance-0.0.2 vs README.md in emittance-0.0.3
- old
+ new
@@ -1,9 +1,10 @@
# Emittance
[![Build Status](https://travis-ci.org/aastronautss/emittance.svg?branch=master)](https://travis-ci.org/aastronautss/emittance)
[![Maintainability](https://api.codeclimate.com/v1/badges/b5900e32c5a385c96c95/maintainability)](https://codeclimate.com/github/aastronautss/emittance/maintainability)
+[![Inline docs](http://inch-ci.org/github/aastronautss/emittance.svg?branch=master)](http://inch-ci.org/github/aastronautss/emittance)
Emittance is a flexible eventing library that provides a clean interface for both emitting and capturing events. It follows the following workflow:
1. Objects (and therefore, classes) can emit events, identified by a symbol.
2. Events are objects that know who emitted them, what time the event was emitted, and any additional information.
@@ -48,20 +49,20 @@
```
As you can see, event types are identified by a symbol. More on that later. You can also pass in an optional payload, which can be any object:
```ruby
-my_foo.emit :something_happened, "Here's a payload!"
+my_foo.emit :something_happened, payload: "Here's a payload!"
```
The above examples are cool, but it's generally a better idea to have an object emit its own events:
```ruby
class Foo
extend Emittance::Emitter
def make_something_happen
- emit :something_happened, "Here's a payload!"
+ emit :something_happened, payload: "Here's a payload!"
end
end
my_foo = Foo.new
my_foo.make_something_happen