engagespark_client 0.1.0 → 0.1.1
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 +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +7 -2
- data/Gemfile.lock +1 -1
- data/README.md +5 -2
- data/lib/engagespark_client/responses/send_sms_response.rb +31 -13
- data/lib/engagespark_client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6db0e2ff575dae2c6104adcfaf13296c9e456a3e9d2d81047bf64b15d98cfbc
|
4
|
+
data.tar.gz: 57b415ad9215cd0efdf36b99abafe709e864269ed48df321ee2c2896c12106cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 107a3ca25652087101cf1330f1e86fe11d89ce2123d782719767f5dc23719fbb34179b597445a7ccf5f3686f5ae90e2eb1d5d159e58049b29003b4d4c45989dd
|
7
|
+
data.tar.gz: 39f94a80ed3f3857446f6938aab7f7a419c2bab01c6765ad65ca541d2c49d1b5e209324125b0405c61834537c487885234ec323cc9940bd93ac809a2a16388c1
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -4,5 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
## [
|
8
|
-
|
7
|
+
## [0.1.1]
|
8
|
+
### Fixed
|
9
|
+
- Fix other methods to easily inspect the attributes of the send sms response
|
10
|
+
|
11
|
+
## [0.1.0]
|
12
|
+
### Added
|
13
|
+
- Initial semi-working version. Only phonenumber API supported
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# EngagesparkClient
|
2
2
|
|
3
|
-
|
3
|
+
[](https://travis-ci.com/bloom-solutions/engagespark_client-ruby)
|
4
|
+
|
5
|
+
Ruby wrapper for the [engageSPARK](https://engagespark.com) API.
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
@@ -22,7 +24,8 @@ Or install it yourself as:
|
|
22
24
|
|
23
25
|
```
|
24
26
|
client = EngagesparkClient.new(token: "YOUR-TOKEN", org_id: 321)
|
25
|
-
|
27
|
+
|
28
|
+
response = client.send_sms(
|
26
29
|
to: "639181234567",
|
27
30
|
message: "Hello, world!",
|
28
31
|
)
|
@@ -3,18 +3,36 @@ module EngagesparkClient
|
|
3
3
|
|
4
4
|
include APIClientBase::Response.module
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
6
|
+
BODY_ATTRS = {
|
7
|
+
error: String,
|
8
|
+
message_id: String,
|
9
|
+
estimate_parts: Integer,
|
10
|
+
estimate_micro: Integer,
|
11
|
+
estimate: Decimal,
|
12
|
+
delivery_deadline: DateTime,
|
13
|
+
contact_id: Integer,
|
14
|
+
to: String,
|
15
|
+
message: String,
|
16
|
+
}.freeze
|
17
|
+
|
18
|
+
attribute :body, String, lazy: true, default: :default_body
|
19
|
+
attribute :parsed_body, String, lazy: true, default: :default_parsed_body
|
20
|
+
|
21
|
+
BODY_ATTRS.each do |attr, type|
|
22
|
+
attribute attr, type, lazy: true, default: :"default_#{attr}"
|
23
|
+
|
24
|
+
define_method "default_#{attr}" do
|
25
|
+
parsed_body[attr.to_s.camelize(:lower)]
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def default_body
|
30
|
+
raw_response.body
|
31
|
+
end
|
32
|
+
|
33
|
+
def parsed_body
|
34
|
+
JSON.parse(body)
|
35
|
+
end
|
36
|
+
|
19
37
|
end
|
20
38
|
end
|