notifiable-sender 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/notifiable/sender.rb +9 -0
- data/lib/notifiable/sender/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1ae206ec86fe659ee390eaa8ae8ee97248d0d66
|
4
|
+
data.tar.gz: 0903c9126a89e843019ea8db0784e40ffeabdc16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2abfd9b8619fc2b421edceb477680c8cab9a439cdcd76a73f6071c838bcf9aeaad53a494db1c18bfd6a149f0a4bd9b4c229e5db893197832dbb976740248e1f9
|
7
|
+
data.tar.gz: d9b825d22c6b6b0a702ef709c0c83c4806c06849ddb8d4158847d07e13c405adf501af6486df5f0780373d96dcd100dd1e820a2b4c2c6168313cfe586f6b30a9
|
data/lib/notifiable/sender.rb
CHANGED
@@ -12,11 +12,20 @@ module Notifiable
|
|
12
12
|
@base_uri, @access_id, @secret_key, @logger = base_uri, access_id, secret_key, logger
|
13
13
|
end
|
14
14
|
|
15
|
+
def send_notification_to_users(user_aliases, title: nil, message: nil, parameters: nil, content_available: nil)
|
16
|
+
raise 'user_aliases should be Enumerable' unless user_aliases.is_a? Enumerable
|
17
|
+
|
18
|
+
user_aliases.each {|user_alias| send_notification_to_user(user_alias, title, message, parameters, content_avaiable)}
|
19
|
+
end
|
20
|
+
|
15
21
|
def send_notification_to_user(user_alias, title: nil, message: nil, parameters: nil, content_available: nil)
|
16
22
|
filters = [{property: "user_alias", predicate: "eq", value: user_alias}]
|
17
23
|
send_notification(title: title, message: message, parameters: parameters, content_available: content_available, filters: filters)
|
18
24
|
end
|
19
25
|
|
26
|
+
#
|
27
|
+
# Params:
|
28
|
+
# - filters: An array of hashes to filter notifications, e.g. [{property: "alert_level", predicate: "lt", value: 3}]
|
20
29
|
def send_notification(title: nil, message: nil, parameters: nil, filters: nil, content_available: nil)
|
21
30
|
body = {}
|
22
31
|
body[:title] = title unless title.nil?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notifiable-sender
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brooke-Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|