hey-you-nexmo 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dea44257bac4517e0971eab1386ffbe2be99e2492f0d2325c9ef4875c8c60cba
4
- data.tar.gz: d3531a2ea603d81c0982d8f14af56890cf4d9610e6c579412077d682f219632d
3
+ metadata.gz: 17bb86cae428f8199158a06ed69a271d6baa1ac325408a85af9613b72f9f6cb8
4
+ data.tar.gz: 6ecb8566a68bf91b2c04d6621402c320747f2a47677b4dee3183ce99e5ca315c
5
5
  SHA512:
6
- metadata.gz: b1a808416d100ec54cf41120d408d8c53a62596e8303353191a94db5d1dd8f837a1ae0f16acdce5d4992791f95ecdf6b973605a9c9ac039f011e5741aa59297b
7
- data.tar.gz: af7ee318b0fcda3640fa7a576f9f87cccf9a3670d9e5e7d42a9ac57b2ecfae02be9ee578f8e4af82316d0113aba9e1d73d0a038e6fe4fc538b305863c2088d75
6
+ metadata.gz: 9473741f464bdb31d3551afefc2d1a50a2062c0ec5ffe716b02acb865e5de71d46e405cdae71a2965a63ac88a24876eb7326e667062d98044629b607d4ff83d8
7
+ data.tar.gz: cffe5a61a1333d9e37aaf3e4ad2ea69508360a6b97db8814d9bad2983175fa811a52c1bf7df2eab8c68170d913b070097f13911ab7ccad8a70a852acd01afcf9
@@ -1,4 +1,7 @@
1
1
  # Changelog for hey-you-nexmo gem
2
2
 
3
+ ### 0.1.2
4
+ - Feature: new `response_handler` configuration for processing `Nexmo::Build` object
5
+
3
6
  ### 0.1.1
4
7
  - Fix: Interpolation for text in builder
data/README.md CHANGED
@@ -48,6 +48,9 @@ HeyYou::Config.configure do
48
48
  # [Boolean] optional - If you will send unicode texts
49
49
  config.nexmo.is_unicode = true
50
50
 
51
+ # [Block] optional - Response handle (block which accept Nexmo::Response object)
52
+ config.nexmo.response_hander = proc { |response| CheckActualBalanceJob.perform_async(response) }
53
+
51
54
  # Check https://developer.nexmo.com/api/sms#delivery-receipt for more info about settings below
52
55
  config.nexmo.ttl = 90000
53
56
  config.nexmo.status_report_req = true
@@ -22,7 +22,10 @@ module HeyYou
22
22
 
23
23
  params = build_params(builder, **options)
24
24
 
25
- config.nexmo.client.sms.send(params)
25
+ result = config.nexmo.client.sms.send(params)
26
+ config.nexmo.response_handler.call(result) if config.nexmo.response_handler
27
+
28
+ result
26
29
  rescue ::Nexmo::Error => e
27
30
  fail ResponseError, e
28
31
  end
@@ -10,7 +10,7 @@ module HeyYou
10
10
  ttl: 259200000 # 72 hours
11
11
  }.freeze
12
12
 
13
- attr_accessor :client, :from, :is_unicode, :ttl, :status_report_req, :callback
13
+ attr_accessor :client, :from, :is_unicode, :ttl, :status_report_req, :callback, :response_handler
14
14
 
15
15
  def initialize
16
16
  @is_unicode = DEFAULTS[:is_unicode]
@@ -1,3 +1,3 @@
1
1
  module HeyYouNexmo
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hey-you-nexmo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Nesterov