simple_spark 0.0.5 → 0.0.6

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
  SHA1:
3
- metadata.gz: cd347b4dc4e50f6b0ee4b2d8679bbad9f70cc6c5
4
- data.tar.gz: 4c1c0584b9bb8fd021823a57ceac610e26815797
3
+ metadata.gz: 48f67a4d104d2173d2e603bf2408f0e487c5a7fa
4
+ data.tar.gz: 558790542ce8eaa9de855a100551687cc6cd5d69
5
5
  SHA512:
6
- metadata.gz: dd54320ae089dad8d23a9b8ead92bab3fe8475bef7d4d8e0d2822b0e5203a288ad223de4ab2b27b6dfc7bb88a239e9fec179d7e4cc252ff04a8d166c76ecc70a
7
- data.tar.gz: 8ffdad3040e019cde03055e5dd2da7cc4d0160e94aaa0304744a86113d2884619c7561e4d40519bd3a51438dca437f79cbcf105a2bc51c36d14103028bcd8ccf
6
+ metadata.gz: e9cdf1aeddc939693f6cd34be0712a890ef0810301cdb69b7ed910d9ce2d5c8c1f5e8e4461620e057ec0dd1c805ad8426491cb787d6c7a3e4ebc99aaabd4524c
7
+ data.tar.gz: 9dc6f8b0cb0e29cf1a1b7fbf1aede1cbb30d9a7f812e454cced9eef79ecb63255649e981af413a65da5e96e303164eaba9c3ac1632005b0de737c348189aa879
data/README.md CHANGED
@@ -102,7 +102,13 @@ simple_spark.metrics.discoverability_links
102
102
  Summary of metrics
103
103
 
104
104
  ```ruby
105
- simple_spark.metrics.deliverability_metrics_summary(from: '2013-04-20T07:12', to: '2018-04-20T07:12', metrics: 'count_accepted', timezone: 'America/New_York')
105
+ properties = {
106
+ from: '2013-04-20T07:12',
107
+ to: '2018-04-20T07:12',
108
+ metrics: 'count_accepted',
109
+ timezone: 'America/New_York'
110
+ }
111
+ simple_spark.metrics.deliverability_metrics_summary(properties)
106
112
  ```
107
113
 
108
114
  <a href="https://developers.sparkpost.com/api/#/reference/metrics/discoverability-links/deliverability-metrics-summary" target="_blank">see SparkPost API Documentation</a>
@@ -112,7 +118,13 @@ simple_spark.metrics.deliverability_metrics_summary(from: '2013-04-20T07:12', to
112
118
  Metrics grouped by Domain
113
119
 
114
120
  ```ruby
115
- simple_spark.metrics.deliverability_metrics_by_domain(from: '2013-04-20T07:12', to: '2018-04-20T07:12', metrics: 'count_accepted', timezone: 'America/New_York')
121
+ properties = {
122
+ from: '2013-04-20T07:12',
123
+ to: '2018-04-20T07:12',
124
+ metrics: 'count_accepted',
125
+ timezone: 'America/New_York'
126
+ }
127
+ simple_spark.metrics.deliverability_metrics_by_domain(properties)
116
128
  ```
117
129
 
118
130
  <a href="https://developers.sparkpost.com/api/#/reference/metrics/deliverability-metrics/deliverability-metrics-by-domain" target="_blank">see SparkPost API Documentation</a>
@@ -122,7 +134,13 @@ simple_spark.metrics.deliverability_metrics_by_domain(from: '2013-04-20T07:12',
122
134
  Metrics grouped by Sending Domain
123
135
 
124
136
  ```ruby
125
- simple_spark.metrics.deliverability_metrics_by_sending_domain(from: '2013-04-20T07:12', to: '2018-04-20T07:12', metrics: 'count_accepted', timezone: 'America/New_York')
137
+ properties = {
138
+ from: '2013-04-20T07:12',
139
+ to: '2018-04-20T07:12',
140
+ metrics: 'count_accepted',
141
+ timezone: 'America/New_York'
142
+ }
143
+ simple_spark.metrics.deliverability_metrics_by_sending_domain(properties)
126
144
  ```
127
145
 
128
146
  <a href="https://developers.sparkpost.com/api/#/reference/metrics/deliverability-metrics/deliverability-metrics-by-sending-domain" target="_blank">see SparkPost API Documentation</a>
@@ -132,7 +150,13 @@ simple_spark.metrics.deliverability_metrics_by_sending_domain(from: '2013-04-20T
132
150
  Metrics grouped by Subaccount
133
151
 
134
152
  ```ruby
135
- simple_spark.metrics.deliverability_metrics_by_subaccount(from: '2013-04-20T07:12', to: '2018-04-20T07:12', metrics: 'count_accepted', timezone: 'America/New_York')
153
+ properties = {
154
+ from: '2013-04-20T07:12',
155
+ to: '2018-04-20T07:12',
156
+ metrics: 'count_accepted',
157
+ timezone: 'America/New_York'
158
+ }
159
+ simple_spark.metrics.deliverability_metrics_by_subaccount(properties)
136
160
  ```
137
161
 
138
162
  <a href="https://developers.sparkpost.com/api/#/reference/metrics/deliverability-metrics/deliverability-metrics-by-subaccount" target="_blank">see SparkPost API Documentation</a>
@@ -142,7 +166,13 @@ simple_spark.metrics.deliverability_metrics_by_subaccount(from: '2013-04-20T07:1
142
166
  Metrics grouped by Campaign
143
167
 
144
168
  ```ruby
145
- simple_spark.metrics.deliverability_metrics_by_campaign(from: '2013-04-20T07:12', to: '2018-04-20T07:12', metrics: 'count_accepted', timezone: 'America/New_York')
169
+ properties = {
170
+ from: '2013-04-20T07:12',
171
+ to: '2018-04-20T07:12',
172
+ metrics: 'count_accepted',
173
+ timezone: 'America/New_York'
174
+ }
175
+ simple_spark.metrics.deliverability_metrics_by_campaign(properties)
146
176
  ```
147
177
 
148
178
  <a href="https://developers.sparkpost.com/api/#/reference/metrics/deliverability-metrics/deliverability-metrics-by-campaign" target="_blank">see SparkPost API Documentation</a>
@@ -152,7 +182,13 @@ simple_spark.metrics.deliverability_metrics_by_campaign(from: '2013-04-20T07:12'
152
182
  Metrics grouped by Template
153
183
 
154
184
  ```ruby
155
- simple_spark.metrics.deliverability_metrics_by_template(from: '2013-04-20T07:12', to: '2018-04-20T07:12', metrics: 'count_accepted', timezone: 'America/New_York')
185
+ properties = {
186
+ from: '2013-04-20T07:12',
187
+ to: '2018-04-20T07:12',
188
+ metrics: 'count_accepted',
189
+ timezone: 'America/New_York'
190
+ }
191
+ simple_spark.metrics.deliverability_metrics_by_template(properties)
156
192
  ```
157
193
 
158
194
  <a href="https://developers.sparkpost.com/api/#/reference/metrics/deliverability-metrics/deliverability-metrics-by-template" target="_blank">see SparkPost API Documentation</a>
@@ -243,10 +279,14 @@ simple_spark.subaccounts.list
243
279
  Create a new Subaccount
244
280
 
245
281
  ```ruby
246
- simple_spark.subaccounts.create({ "name": "Sparkle Ponies", "key_label": "API Key for Sparkle Ponies Subaccount", "key_grants": ["smtp/inject", "sending_domains/manage", "message_events/view", "suppression_lists/manage"] })
282
+ properties = {
283
+ name: 'Sparkle Ponies', key_label: 'API Key for Sparkle Ponies Subaccount',
284
+ key_grants: ['smtp/inject', 'sending_domains/manage', 'message_events/view', 'suppression_lists/manage']
285
+ }
286
+ simple_spark.subaccounts.create(properties)
247
287
  ```
248
288
 
249
- <a href="hhttps://developers.sparkpost.com/api/#/reference/subaccounts/subaccounts-collection/create-new-subaccount" target="_blank">see SparkPost API Documentation</a>
289
+ <a href="https://developers.sparkpost.com/api/#/reference/subaccounts/subaccounts-collection/create-new-subaccount" target="_blank">see SparkPost API Documentation</a>
250
290
 
251
291
  #### Retrieve
252
292
 
@@ -626,6 +666,10 @@ simple_spark.templates.delete(yourtemplateid)
626
666
 
627
667
  ## Changelog
628
668
 
669
+ ### 0.0.6
670
+
671
+ Fixed accidental bug
672
+
629
673
  ### 0.0.5
630
674
 
631
675
  - Subaccounts endpoint added
@@ -4,12 +4,12 @@ require 'json'
4
4
 
5
5
  module SimpleSpark
6
6
  class Client
7
- def initialize(options = {})
8
- @api_key = options[:api_key] || ENV['SPARKPOST_API_KEY']
9
- @api_host = options[:api_host] || 'https://api.sparkpost.com'
10
- @base_path = options[:base_path] || '/api/v1/'
11
- @subaccount_id = options[:subaccount_id]
12
- @headers = options[:headers]
7
+ def initialize(opts = {})
8
+ @api_key = opts[:api_key] || ENV['SPARKPOST_API_KEY']
9
+ @api_host = opts[:api_host] || 'https://api.sparkpost.com'
10
+ @base_path = opts[:base_path] || '/api/v1/'
11
+ @subaccount_id = opts[:subaccount_id]
12
+ @headers = opts[:headers]
13
13
 
14
14
  fail Exceptions::InvalidConfiguration.new, 'You must provide a SparkPost API key' unless @api_key
15
15
  fail Exceptions::InvalidConfiguration.new, 'You must provide a SparkPost API host' unless @api_host # this should never occur unless the default above is changed
@@ -18,7 +18,7 @@ module SimpleSpark
18
18
 
19
19
  rails_development = true & defined?(Rails) && Rails.env.development?
20
20
 
21
- @debug = options[:debug].nil? ? rails_development : options[:debug]
21
+ @debug = opts[:debug].nil? ? rails_development : opts[:debug]
22
22
 
23
23
  @session = Excon.new(@api_host, debug: @debug)
24
24
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleSpark
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_spark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jak Charlton