engagespark_client 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75bdb976f67e5fd0cebc4ec79abcded8177ca65e78b569d64293b670881beaad
4
- data.tar.gz: 1be77429cb1176aca6fcccca3ab8aea9de7c84a94834ae20125a42f5bcff2920
3
+ metadata.gz: c6db0e2ff575dae2c6104adcfaf13296c9e456a3e9d2d81047bf64b15d98cfbc
4
+ data.tar.gz: 57b415ad9215cd0efdf36b99abafe709e864269ed48df321ee2c2896c12106cf
5
5
  SHA512:
6
- metadata.gz: 6e79a9ea1acb1c43a41aa5e1054a9d86e9b9b0d81a00381c70d79de0264206b83b5ddb9dafc6f1691ff722b434039de7e119ad9cac9d5d90f12d7ed9abbddc77
7
- data.tar.gz: d4c722a54fd227af2a0e90ef1a1d22c378fc8e1c81d5c2d9325c8a0c48234e10a4589412686f24a0694588ae14f12281fa295188638b30c240e0c4d7fce186da
6
+ metadata.gz: 107a3ca25652087101cf1330f1e86fe11d89ce2123d782719767f5dc23719fbb34179b597445a7ccf5f3686f5ae90e2eb1d5d159e58049b29003b4d4c45989dd
7
+ data.tar.gz: 39f94a80ed3f3857446f6938aab7f7a419c2bab01c6765ad65ca541d2c49d1b5e209324125b0405c61834537c487885234ec323cc9940bd93ac809a2a16388c1
@@ -5,3 +5,5 @@ cache: bundler
5
5
  rvm:
6
6
  - 2.6.3
7
7
  before_install: gem install bundler -v 2.0.2
8
+ before_script:
9
+ - cp spec/config{.sample,}.yml
@@ -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
- ## [Unreleased]
8
- - Initial version. Only phonenumber API supported
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- engagespark_client (0.1.0)
4
+ engagespark_client (0.1.1)
5
5
  activesupport (>= 5.0)
6
6
  api_client_base (~> 1.0)
7
7
  typhoeus (~> 1.0)
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # EngagesparkClient
2
2
 
3
- Ruby wrapper for the engageSPARK API.
3
+ [![Build Status](https://travis-ci.com/bloom-solutions/engagespark_client-ruby.svg?branch=master)](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
- client.send_sms(
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
- attribute :error, String, lazy: true, default: :default_error
7
- attribute :message_id, String, lazy: true, default: :default_message_id
8
- attribute(:estimate_parts, Integer, {
9
- lazy: true,
10
- default: :default_estimate_parts,
11
- })
12
- attribute :estimate_micro, Integer, lazy: true, default: :default_estimate_micro
13
- attribute :estimate, Decimal, lazy: true, default: :default_estimate
14
- attribute :delivery_deadline, DateTime, lazy: true, default: :default_delivery_deadline
15
- attribute :contact_id, Integer, lazy: true, default: :default_contact_id
16
- attribute :to, String, lazy: true, default: :default_to
17
- attribute :message, String, lazy: true, default: :default_message
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
@@ -1,3 +1,3 @@
1
1
  module EngagesparkClient
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engagespark_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ramon Tayag