sms_traffic_sdk 0.0.4 → 0.0.6

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
  SHA256:
3
- metadata.gz: 56aa0cade898c0945faa7a4db5b1ffe993961790f1da8620ad8f78f931f3bf10
4
- data.tar.gz: 9f3cb3dc53572c1cd217fe9f2dda5026341f4236955717c03c286ed1385d4b0a
3
+ metadata.gz: 0e85b3c32d98346ebf1fb44dfcbabe91026b574f4d840093266a1940130f31ed
4
+ data.tar.gz: 0dad2e6b0a10cdc53f6e9a6de8eeeca8cc51d32138256df6f38cf28a59dd73a2
5
5
  SHA512:
6
- metadata.gz: 670f8dd039cc41234e4a477f1a1ac1007f7fc2374d1823776a5975848910c3cd0c5c087f72a2986e07c3f81bae579a3d670548bc8f872e5eb5bde90933c0bf1e
7
- data.tar.gz: 61599f0d3633bf2a2220a662de705888beb20e535e722627f709cf18380a7859b256e619afdab615f86cbdd24c19ad5386dc559255a64043bf09e77acbd362af
6
+ metadata.gz: 5160c86f9f2830a2be3053c54388ddc4a74873540175a84035c3e1c1568a257d0b51a4c59b2f2d0ee89fbb59339e70e8ff48d9f2368d3745f40881ca7bd9a06d
7
+ data.tar.gz: 760bc18cd52aea419fd12503b889799ebee7e7c8b4fb3688e0052eef2689f389725d3f7022b76e322cb2daea1c42afb996000ce1631d3c49da1b928e4f54ff1b
@@ -33,15 +33,17 @@ module SmsTraffic
33
33
  message_info = fetch_value(message_infos, :message_info)
34
34
  return fetch_value(message_info, :sms_id) if message_info.is_a?(Hash) || message_info.nil?
35
35
 
36
- raise ArgumentError, 'phone is required' unless phone
37
-
38
- fetch_value(find_message_info(phone), :sms_id)
36
+ if phone
37
+ fetch_value(find_message_info(phone), :sms_id)
38
+ elsif message_info.is_a?(Array)
39
+ fetch_value(message_info.first, :sms_id)
40
+ end
39
41
  end
40
42
 
41
43
  def sms_ids
42
44
  message_info = fetch_value(message_infos, :message_info)
43
45
 
44
- return [fetch_value(message_info, :sms_id)] if message_info.size == 1
46
+ return [fetch_value(message_info, :sms_id)] if message_info&.size == 1
45
47
 
46
48
  message_info.each_with_object({}) do |info, hash|
47
49
  hash[fetch_value(info, :phone)] = fetch_value(info, :sms_id)
@@ -26,7 +26,7 @@ module SmsTraffic
26
26
 
27
27
  if reply.ok?
28
28
  @status = 'sent'
29
- @id = reply.sms_id(phone)
29
+ @id = reply.sms_id || reply.sms_ids.values.first
30
30
  true
31
31
  else
32
32
  @errors << (reply.error_description || 'Sms has been not enqueued')
@@ -1,3 +1,3 @@
1
1
  module SmsTraffic
2
- VERSION = '0.0.4'.freeze
2
+ VERSION = '0.0.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sms_traffic_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Rybolovlev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-09 00:00:00.000000000 Z
11
+ date: 2024-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri