sms_center 0.0.7 → 0.0.8

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: b7937daee7e4fbb94d6e21d017a704ef230209867075d9669986988dfb81703f
4
- data.tar.gz: 472c26f4f4a279248e732f59973f3337f66763e8da1a667c7b2e8f90cca5f319
3
+ metadata.gz: 4567b272b4936f87d5ac41e6f7a6780451d0859ff25800f7cd1a5a01ff15c2dd
4
+ data.tar.gz: 0f2bfae548a50ea7edcfe94aa0502925f01f861d8faa607f94fcfbd9e1042490
5
5
  SHA512:
6
- metadata.gz: 54e783f51469480cc21276682390d8bd22edb6c38dfcb5dac34fddd0498187d8b590a9f4fd474c757b27f35a7639c9047dde8b6f6a399086e00b189c51962a69
7
- data.tar.gz: 3759499944f9f100de7f67f52b6be3b8a8942bf83c8ed07e6f88872cdf5804e37b7744e6ffdf37f3c07b8533a0033d01d47c7178f64c9cabf0f830e7ca810fb6
6
+ metadata.gz: 9366470c499324fdaa4dcd7706cce03907bae37f45eda2a1e9623ae7b53962e809ceac50edc28e13737553cd2a87178f4305bb7212cca0a7cc06aaee6912a4d1
7
+ data.tar.gz: 891bc47345ff2f44d93fdb6dc0c51da2886b893b830d6012c88a550d56aee0f390c505c3354d4a59400ccaab2b65c4972dd8faa741df80a952d441af4d402c6a
@@ -10,7 +10,7 @@ class SmsCenter::Telerivet
10
10
  @body = {
11
11
  "content": content,
12
12
  "to_number": to_number
13
- }
13
+ }.to_json
14
14
  @body["from_number"] = from_number if from_number
15
15
  end
16
16
  end
data/lib/sms_center.rb CHANGED
@@ -36,19 +36,14 @@ class SmsCenter
36
36
  @@root_number_by_platform
37
37
  end
38
38
 
39
- def initialize(content, to_number, options = {})
39
+ def initialize(content, to_number, country, platform = nil)
40
40
  platform_by_country = SmsCenter.platform_by_country
41
- country = options[:country]
42
- platform = options[:platform]
43
-
44
- f_platform = country.present? ? platform_by_country[country.downcase.to_sym] : platform_by_country[:default]
45
- f_platform = platform.downcase.capitalize if platform.present?
46
-
47
- from_number = SmsCenter.root_number_by_platform[f_platform.to_sym]
48
- @request = SmsCenter.const_get(f_platform, false).new(content, to_number, from_number, @@keys)
41
+ platform = platform_by_country[country.downcase.to_sym] || platform_by_country[:default] unless platform
42
+ from_number = SmsCenter.root_number_by_platform[platform.to_sym]
43
+ @request = SmsCenter.const_get(platform, false).new(content, to_number, from_number, @@keys)
49
44
  end
50
45
 
51
46
  def send
52
- HTTPClient.new.post_async(@request.api_url, @request.body, @request.headers)
47
+ RestClient.post(@request.api_url, @request.body, @request.headers)
53
48
  end
54
49
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sms_center
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Deleveree
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  requirements: []
56
- rubygems_version: 3.0.3
56
+ rubygems_version: 3.0.8
57
57
  signing_key:
58
58
  specification_version: 4
59
59
  summary: Deliveree!