notifiable-sender 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -10
- data/lib/notifiable/sender/version.rb +1 -1
- data/lib/notifiable/sender.rb +2 -2
- 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: fd58196fd6796f7c7cdd49cdc504fd7b6df8adc7
|
4
|
+
data.tar.gz: 11a8004e4c3aee8054ad14b78510fb2ee03e21bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b721862a60ddf7c986f263ca14d6760fa901f4f9ab1095e00ab3e55bfd26f85c32c7e5d80d2f947ba2e9b97ba3b5cc4a081e57f668275d6e8534191db449a18a
|
7
|
+
data.tar.gz: 9c996befb2d1e364d45062c9879e087e54103b1b2fbbe08f96f1691268d01a2596ccca1b23e520b19fb1f6d7f8a8e9a75ea2b220d3966e237870529f85503632
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# Notifiable::Sender
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Wrapper for the notifiable notifications API. Use this to send notifications from Ruby code.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,13 +20,10 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
23
|
+
```ruby
|
24
|
+
notifiable = Notifiable::Sender.new(ENV['notifiable_access_id'])
|
25
|
+
notifiable.send_notification(message: 'Hello notifiable')
|
26
|
+
```
|
32
27
|
|
33
28
|
## Contributing
|
34
29
|
|
data/lib/notifiable/sender.rb
CHANGED
@@ -6,8 +6,8 @@ require 'logger'
|
|
6
6
|
module Notifiable
|
7
7
|
class Sender
|
8
8
|
def initialize(access_id, base_uri: 'https://notifiable.futureworkshops.com', secret_key: nil, logger: Logger.new(STDOUT))
|
9
|
-
raise 'base_uri cannot be nil' if base_uri.empty?
|
10
|
-
raise 'access_id cannot be nil' if access_id.empty?
|
9
|
+
raise 'base_uri cannot be nil' if !base_uri || base_uri.empty?
|
10
|
+
raise 'access_id cannot be nil' if !access_id || access_id.empty?
|
11
11
|
|
12
12
|
@base_uri, @access_id, @secret_key, @logger = base_uri, access_id, secret_key, logger
|
13
13
|
end
|