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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f178b47d51bce112434a172275e8f6c1b5772c4
4
- data.tar.gz: 5de1c530ac6212a5fe80e47346ef06f2e2b1eb22
3
+ metadata.gz: 8c4cdf8c957478f42068e095c2c3a84f6ec141c4
4
+ data.tar.gz: a44a1d79a8e7c2343038f95e0cc933298e03f837
5
5
  SHA512:
6
- metadata.gz: 24ec4dc5c4f23dedc19a21431773ef0370935946d3b7a9a5b8f767b63a4782b694dd5fe81534838a1e379b78b4aaf9ccb25bb1138c30f10bdfc48336a4268f3f
7
- data.tar.gz: 722b3a9549d80060324b576068e1094d235edcd8daa13e2e96d73c555ac827678ee4a50a78964fdd3fcbe44f07eaeded42b1d1b9cb10093ebd2d850697a85531
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.0
1
+ 2.7.1
@@ -10,11 +10,15 @@ module EasyPost
10
10
  end
11
11
 
12
12
  def self.retrieve(params, api_key=nil)
13
- url = "#{self.url}/#{params[:type]}/#{params[:id]}"
14
- obj_id = params[:id].split("_")[0]
13
+ id = if params.is_a?(String)
14
+ params
15
+ else
16
+ params[:id]
17
+ end
15
18
 
16
- response, api_key = EasyPost.request(:get, url, api_key, params)
17
- return EasyPost::Util::convert_to_easypost_object(response, api_key) if response
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)
@@ -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(type: TYPE, id: report_1.id)
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.0
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-04-04 00:00:00.000000000 Z
11
+ date: 2017-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client