nala 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/lib/nala/publisher.rb +3 -1
- data/lib/nala/version.rb +1 -1
- data/readme.md +13 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e24b33814fd472cb82c0a1df0245dd50bca407cc
|
4
|
+
data.tar.gz: 7acae49d029d2c69fb61777de30f37384f0b3bb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c9e49b94f37ac4f107781016db0b19851c3e02e7aaad1dc71b99fba3f490a8e45e28eb7de98641d63f3a380c12369a908e63d3cf68e1d1c38e77168c831aa0b
|
7
|
+
data.tar.gz: ea4cf4ed1e5a030634c77847b93fbd214c66a072f6d26ebf7c25acad960e828972ceea4018414620eb5f4f1c157726dbca8633c486f345c446f5678f6b502897
|
data/LICENSE.txt
CHANGED
data/lib/nala/publisher.rb
CHANGED
data/lib/nala/version.rb
CHANGED
data/readme.md
CHANGED
@@ -7,12 +7,12 @@ Lightweight gem for adding events to use case style classes.
|
|
7
7
|
To install via RubyGems run:
|
8
8
|
|
9
9
|
```
|
10
|
-
gem install nala
|
10
|
+
$ gem install nala
|
11
11
|
```
|
12
12
|
|
13
13
|
To install via bundler, add this line to your Gemfile and run `bundle install`:
|
14
14
|
|
15
|
-
```
|
15
|
+
```ruby
|
16
16
|
gem "nala"
|
17
17
|
```
|
18
18
|
|
@@ -83,6 +83,16 @@ class RegistrationController < ApplicationController
|
|
83
83
|
end
|
84
84
|
```
|
85
85
|
|
86
|
+
If in some cases you don't need to handle the events, you can either use `.call` or `#call` depending on your preference as internal calls to `#publish` will be ignored.
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
PlaceOrder.call(order_params)
|
90
|
+
|
91
|
+
# or
|
92
|
+
|
93
|
+
PlaceOrder.new(order_params).call
|
94
|
+
```
|
95
|
+
|
86
96
|
## Testing with RSpec
|
87
97
|
|
88
98
|
If you are using RSpec then you can use the supplied matcher by adding the
|
@@ -156,7 +166,7 @@ just `block`):
|
|
156
166
|
let(:success) { Nala::BlockSpy.new }
|
157
167
|
let(:notified) { Nala::BlockSpy.new }
|
158
168
|
|
159
|
-
it "
|
169
|
+
it "calls multiple handlers" do
|
160
170
|
PlaceOrder.call
|
161
171
|
.on(:success, &success.spy)
|
162
172
|
.on(:notified, ¬ified.spy)
|