sms_traffic_sdk 0.0.3 → 0.0.5

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: a24fc568f771f8a36b3b9c6cf8593b653441ca3f98bba4ab214a26f4cdbee01b
4
- data.tar.gz: 5a1bf2789cba41f9334199342efed9d0d8e3c0ddaf6aba581fe99797ae10ff82
3
+ metadata.gz: e0bcb647f2676acb5a33310c9d5275071abddc53acaf12967b097b6b1ff2102e
4
+ data.tar.gz: 95803398f4a413625a5e434e2a875f7568faa99c16734addc9353afa49a023fe
5
5
  SHA512:
6
- metadata.gz: 0546d6134d67834a19e5ec0fcc97f8ecc6e5db0de31bb2cba5c13780097554abc866ce1702974bf51ef958204b46603f3ff6b2bf97e595f8c3388b946e9338de
7
- data.tar.gz: 2aca58a629bc318d0da343486c2ed2072f2048b774dee6507aa23b8e5209adaaf80312fd76a4ade0d075234bf08db940aa04ba54ccfb865943ce4ba063997bef
6
+ metadata.gz: 11caf5807c9951b1ed43ff966e00a1e95f0b11cb876849768e6c7d8c98aaff23c747b3c370c616a114059ca3efa0b5f6c692fa98bc8401c208cab5963065121d
7
+ data.tar.gz: 9c9b229a2eb7479d4dd76cd132d178025a701f92bfeaf19ab9660aa7c394447b1592120907768d91bfa489781f17721c7105c0273471792d2c807ed117f93976
@@ -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
29
+ @id = reply.sms_id(phone)
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.3'.freeze
2
+ VERSION = '0.0.5'.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.3
4
+ version: 0.0.5
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-09-13 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