notifiable-sender 0.5.0 → 0.6.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: dbdf093fac13072d95a1ffb4747f1f7c9f969892
4
- data.tar.gz: d0bf436f49feaeefdf91da989b9ea1e4f3337637
3
+ metadata.gz: de83e365970e1c59cc5c5d4581b0bdb47285926d
4
+ data.tar.gz: f7c89b24d305dbe22f6b06c3119e302ac44325fd
5
5
  SHA512:
6
- metadata.gz: d847129b5cfbc2bc15fc278971951a42c17ddbcf667127b8f9ebb4e5dc0e6f87a63b105e77fd3e25732f4c552f9d4e91fa80ef9a2ef17b7da1013a6b9415bdae
7
- data.tar.gz: 22c3cb54d67627a37b1acf7c6b9910d9528ed7efb84dc612fe66a501a493c69a22b0b579d7922d4282eb83e30b71b400e05f8c1bebc5201f68567cd061290e91
6
+ metadata.gz: 4b170280090a2c800cf1925722a1b63299ef33208f29ac5dfdc77ba7b9cf7f207811c8382c7041d089f456c15b23a2594269b19f03eb36dc85db1659df01e966
7
+ data.tar.gz: d79e18ad8fffc195d3046f0fe43958083e6dddbea14d262fa0be81360db517cb459c1273353031474139471fa46d4f84897ca830ac487022112c35ce713d17d7
@@ -12,28 +12,30 @@ 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)
15
+ def send_notification_to_users(user_aliases, title: nil, message: nil, parameters: nil, content_available: nil, thread_id: nil)
16
16
  raise 'user_aliases should be an array' unless user_aliases.is_a? Array
17
17
 
18
18
  filters = [{property: "user_alias", predicate: "in", value: user_aliases}]
19
- send_notification(title: title, message: message, parameters: parameters, content_available: content_available, filters: filters)
19
+ send_notification(title: title, message: message, parameters: parameters, content_available: content_available, filters: filters, thread_id: thread_id)
20
20
  end
21
21
 
22
- def send_notification_to_user(user_alias, title: nil, message: nil, parameters: nil, content_available: nil)
22
+ def send_notification_to_user(user_alias, title: nil, message: nil, parameters: nil, content_available: nil, thread_id: nil)
23
23
  filters = [{property: "user_alias", predicate: "eq", value: user_alias}]
24
- send_notification(title: title, message: message, parameters: parameters, content_available: content_available, filters: filters)
24
+ send_notification(title: title, message: message, parameters: parameters, content_available: content_available, filters: filters, thread_id: thread_id)
25
25
  end
26
26
 
27
27
  #
28
28
  # Params:
29
29
  # - filters: An array of hashes to filter notifications, e.g. [{property: "alert_level", predicate: "lt", value: 3}]
30
- def send_notification(title: nil, message: nil, parameters: nil, filters: nil, content_available: nil)
30
+ def send_notification(title: nil, message: nil, parameters: nil, filters: nil, content_available: nil, thread_id: nil)
31
31
  body = {}
32
32
  body[:title] = title unless title.nil?
33
33
  body[:message] = message unless message.nil?
34
34
  body[:parameters] = parameters.to_json unless parameters.nil?
35
35
  body[:filters] = filters.to_json unless filters.nil?
36
36
  body[:content_available] = content_available unless content_available.nil?
37
+ body[:thread_id] = thread_id unless thread_id.nil?
38
+
37
39
  headers = {}
38
40
  headers[:authorization] = @access_id unless @secret_key
39
41
  @request = RestClient::Request.new url: "#{@base_uri}/api/v1/notifications", payload: {notification: body}, method: :post, headers: headers
@@ -1,3 +1,3 @@
1
1
  module Notifiable
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.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.5.0
4
+ version: 0.6.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-06-10 00:00:00.000000000 Z
11
+ date: 2018-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client