easypost 2.7.0 → 2.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +11 -0
- data/VERSION +1 -1
- data/lib/easypost/report.rb +8 -4
- data/spec/report_spec.rb +13 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c4cdf8c957478f42068e095c2c3a84f6ec141c4
|
4
|
+
data.tar.gz: a44a1d79a8e7c2343038f95e0cc933298e03f837
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb9664b47721a6f14be45a0d7042875990e3454d7c21cde4be66d104dc7e9b8358be8ddf9106b1212086aa4cdc80d4a3bc1c32a9a2ca339edf2685112a322e52
|
7
|
+
data.tar.gz: a7956f59bd5ba39691e597486fc5fbad1aa2d90d3357cc63d5f3373177f2ba34fbb3d60f9aaa0f28b5e82d6187df2f5eec5747bb97c83cb0c3130e3b0f188565
|
data/CHANGELOG
CHANGED
@@ -1,27 +1,38 @@
|
|
1
|
+
=== 2.7.1 2017-05-25
|
2
|
+
|
3
|
+
* Allow reports to be retrieved without passing a type
|
4
|
+
|
5
|
+
|
1
6
|
=== 2.7.0 2017-04-04
|
2
7
|
|
3
8
|
* Changed Report CRUD signatures. requires report type to be passed
|
4
9
|
|
10
|
+
|
5
11
|
=== 2.6.2 2017-02-14
|
6
12
|
|
7
13
|
* Added get_rates method for Orders
|
8
14
|
|
15
|
+
|
9
16
|
=== 2.6.1 2017-01-19
|
10
17
|
|
11
18
|
* Updated create method for ScanForms
|
12
19
|
|
20
|
+
|
13
21
|
=== 2.6.0 2017-01-17
|
14
22
|
|
15
23
|
* Add basic CRUD methods for Webhooks
|
16
24
|
|
25
|
+
|
17
26
|
=== 2.5.0 2016-12-19
|
18
27
|
|
19
28
|
* Add prefixes to report in utils
|
20
29
|
|
30
|
+
|
21
31
|
=== 2.4.0 2016-12-08
|
22
32
|
|
23
33
|
* Add report resource to ruby client
|
24
34
|
|
35
|
+
|
25
36
|
=== 2.3.0 2016-11-25
|
26
37
|
|
27
38
|
* Updated dependencies to allow rest-client 2.0.0 and above
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.7.
|
1
|
+
2.7.1
|
data/lib/easypost/report.rb
CHANGED
@@ -10,11 +10,15 @@ module EasyPost
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.retrieve(params, api_key=nil)
|
13
|
-
|
14
|
-
|
13
|
+
id = if params.is_a?(String)
|
14
|
+
params
|
15
|
+
else
|
16
|
+
params[:id]
|
17
|
+
end
|
15
18
|
|
16
|
-
|
17
|
-
|
19
|
+
instance = self.new(id, api_key)
|
20
|
+
instance.refresh
|
21
|
+
return instance
|
18
22
|
end
|
19
23
|
|
20
24
|
def self.all(filters={}, api_key=nil)
|
data/spec/report_spec.rb
CHANGED
@@ -15,13 +15,24 @@ describe EasyPost::Report do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '#retrieve' do
|
18
|
-
it 'retrieves a user created report by public_id' do
|
18
|
+
it 'retrieves a user created report by public_id as a hash' do
|
19
19
|
report_1 = EasyPost::Report.create(
|
20
20
|
start_date: Date.today - 30,
|
21
21
|
end_date: Date.today,
|
22
22
|
type: TYPE
|
23
23
|
)
|
24
|
-
report_2 = EasyPost::Report.retrieve(
|
24
|
+
report_2 = EasyPost::Report.retrieve(id: report_1.id)
|
25
|
+
|
26
|
+
expect(report_2.id).to eq(report_1.id)
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'retrieves a user created report by public_id as a string' do
|
30
|
+
report_1 = EasyPost::Report.create(
|
31
|
+
start_date: Date.today - 30,
|
32
|
+
end_date: Date.today,
|
33
|
+
type: TYPE
|
34
|
+
)
|
35
|
+
report_2 = EasyPost::Report.retrieve(report_1.id)
|
25
36
|
|
26
37
|
expect(report_2.id).to eq(report_1.id)
|
27
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easypost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sawyer Bateman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|