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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ba00b2c996c79f61f5bf2f3a204317401079919
4
- data.tar.gz: c8a61f3d6e16fde2e553fe872af76bfb07daf9e5
3
+ metadata.gz: c1ae206ec86fe659ee390eaa8ae8ee97248d0d66
4
+ data.tar.gz: 0903c9126a89e843019ea8db0784e40ffeabdc16
5
5
  SHA512:
6
- metadata.gz: 8dc67372d8a14a828cebe9bf26990b2308c5187868ba26b534ff6eb04c3535a2262578eb3f2cd84a4f23d2d16de86bbbb8e02a69c59c50e392401eecbc9cd95d
7
- data.tar.gz: 5270dabcf1374f8710294712ebd932e274d22e74c3e941005204238dbcf53f8783a3c3bba50c333e01cca472e642100a87c180fa43a941e59169f1a881372597
6
+ metadata.gz: 2abfd9b8619fc2b421edceb477680c8cab9a439cdcd76a73f6071c838bcf9aeaad53a494db1c18bfd6a149f0a4bd9b4c229e5db893197832dbb976740248e1f9
7
+ data.tar.gz: d9b825d22c6b6b0a702ef709c0c83c4806c06849ddb8d4158847d07e13c405adf501af6486df5f0780373d96dcd100dd1e820a2b4c2c6168313cfe586f6b30a9
@@ -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?
@@ -1,3 +1,3 @@
1
1
  module Notifiable
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.0"
3
3
  end
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.3.3
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-04-02 00:00:00.000000000 Z
11
+ date: 2018-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client