codec_fast_sms 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/codec_fast_sms/client.rb +9 -1
- data/lib/codec_fast_sms/core.rb +3 -2
- data/lib/codec_fast_sms/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ac8e7c4464732862d74fc81abe076b7b9a12ba0301792c5089db189f02186f1
|
4
|
+
data.tar.gz: 32c4588fff41ceaac6874e771e328b0b07a45c7456c643b251822e6aedbeb201
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e75e86f29202b824fab992d601678c4d3fbb0d30a170e0aff8469aaff3343eaad682cab617e084dadfa76c6a2e982031a1b1639ca63639743e4eb1e17dbed555
|
7
|
+
data.tar.gz: 05d82065bb7809c8dbff20b7bf1d0acbfa0da5d24577c0e9f0fa468e906905748def7599a233aab7163479ed8fa9545f4dad7af987554c61730f05615584e3a3
|
data/README.md
CHANGED
@@ -67,6 +67,12 @@ client.deliver(phone, message)
|
|
67
67
|
puts client.response
|
68
68
|
```
|
69
69
|
|
70
|
+
Use attributes to set other parameters:
|
71
|
+
```ruby
|
72
|
+
optional_parameters = { optionalParameters: { disablePermissionFilter: true } }
|
73
|
+
client = CodecFastSms::Client.new(attributes: optional_parameters)
|
74
|
+
```
|
75
|
+
|
70
76
|
We can pass the profile argument on client initialization to use different configuration.
|
71
77
|
```ruby
|
72
78
|
client = CodecFastSms::Client.new(profile: :dynamic_settings)
|
@@ -14,7 +14,8 @@ module CodecFastSms
|
|
14
14
|
password: ::CodecFastSms.configuration(profile).password,
|
15
15
|
sender: ::CodecFastSms.configuration(profile).sender,
|
16
16
|
phone: to, messageContent: message, msgSpecialId: '', isOtn: 'True',
|
17
|
-
headerCode: '', responseType: '3',
|
17
|
+
headerCode: '', responseType: '3',
|
18
|
+
optionalParameters: generate_optional_parameters
|
18
19
|
}
|
19
20
|
end
|
20
21
|
|
@@ -27,5 +28,12 @@ module CodecFastSms
|
|
27
28
|
assign_recipient_information(to, message)
|
28
29
|
perform
|
29
30
|
end
|
31
|
+
|
32
|
+
def generate_optional_parameters
|
33
|
+
attr = attributes[:optionalParameters]
|
34
|
+
return attr if attr.is_a?(Hash) && !attr.empty?
|
35
|
+
|
36
|
+
''
|
37
|
+
end
|
30
38
|
end
|
31
39
|
end
|
data/lib/codec_fast_sms/core.rb
CHANGED
@@ -3,9 +3,10 @@
|
|
3
3
|
module CodecFastSms
|
4
4
|
# Core
|
5
5
|
class Core
|
6
|
-
attr_accessor :connection, :profile, :response, :to, :message
|
7
|
-
def initialize(profile: :default)
|
6
|
+
attr_accessor :connection, :profile, :response, :to, :message, :attributes
|
7
|
+
def initialize(profile: :default, attributes: {})
|
8
8
|
self.profile = profile
|
9
|
+
self.attributes = attributes
|
9
10
|
# Firstly, create a connection object.
|
10
11
|
self.connection = Faraday.new(
|
11
12
|
url: ::CodecFastSms.configuration(profile).api_host
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codec_fast_sms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sertan Gülveren
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -120,7 +120,7 @@ licenses: []
|
|
120
120
|
metadata:
|
121
121
|
homepage_uri: https://github.com/sertangulveren/codec_fast_sms
|
122
122
|
source_code_uri: https://github.com/sertangulveren/codec_fast_sms
|
123
|
-
post_install_message:
|
123
|
+
post_install_message:
|
124
124
|
rdoc_options: []
|
125
125
|
require_paths:
|
126
126
|
- lib
|
@@ -135,8 +135,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
137
|
requirements: []
|
138
|
-
rubygems_version: 3.
|
139
|
-
signing_key:
|
138
|
+
rubygems_version: 3.0.8
|
139
|
+
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: Codec FastSMS Library for Ruby.
|
142
142
|
test_files: []
|