exact_target_rest 0.2.5 → 0.2.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: ad854f206b815f39d753583d315271e4a4dcc414
4
- data.tar.gz: 4983096a2f26a754ba68567f06f11576f7974e41
3
+ metadata.gz: 4fd81d7b51fc3a0a389a5e3e98e9d9d4bbaff41b
4
+ data.tar.gz: 287c1359af2164f62143922b6aa3c3691438041c
5
5
  SHA512:
6
- metadata.gz: e4647a5fd4781a1bdaf4897eed75787c733a056a80edfd84f961ae8e4c21e82da35e1e4069aa17f4168531c0a6e3c1e08dd336daef8c7e7d335b11a574d5691e
7
- data.tar.gz: 0b3a80093dcd0f4034b1e7310596e4e918c3d1ffffbcac5538f63f295b238c49e5d2fb774ef3d79a156db77aec2ac4c21b2e7aa023a797ada87ff9a1d8f7676e
6
+ metadata.gz: ad5925146340d6ef5aeb26ffa2dffdf9410e7eeba2cf4f6eb450bc4cca88d16f4cbef6f5d7f0b96acf92a52545effd39d3edc8d0b22370a698940f955fc3a369
7
+ data.tar.gz: 6f0895367b4ea39a60c6d75b02e8e11152b9b71691b338d45ac73a46ca54d4b438058ad8974fd85f711430a00b0de0f9435bba7a843aef1e187b8ed16dc03daa
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Gem Version](https://badge.fury.io/rb/exact_target_rest.svg)](https://badge.fury.io/rb/exact_target_rest)
2
+
1
3
  # ExactTargetRest
2
4
 
3
5
  Simple wrapper around ExactTarget REST API.
@@ -6,6 +6,7 @@ module ExactTargetRest
6
6
  class Authorization
7
7
  attr_reader :access_token
8
8
  attr_reader :expires_in
9
+ attr_reader :expires_at
9
10
 
10
11
  # New authorization (it does not trigger REST yet).
11
12
  #
@@ -35,7 +36,8 @@ module ExactTargetRest
35
36
  end
36
37
  if resp.success?
37
38
  @access_token = resp.body['accessToken']
38
- @expires_in = Time.now + resp.body['expiresIn']
39
+ @expires_in = resp.body['expiresIn']
40
+ @expires_at = Time.now + @expires_in
39
41
  self
40
42
  else
41
43
  fail NotAuthorizedError
@@ -44,7 +46,7 @@ module ExactTargetRest
44
46
 
45
47
  # Already authorized and NOT expired?
46
48
  def authorized?
47
- @access_token && @expires_in > Time.now
49
+ @access_token && @expires_at > Time.now
48
50
  end
49
51
 
50
52
  protected
@@ -1,3 +1,3 @@
1
1
  module ExactTargetRest
2
- VERSION = '0.2.5'
2
+ VERSION = '0.2.6'
3
3
  end
@@ -55,7 +55,7 @@ describe Authorization do
55
55
  it "returns FALSE when authorization Expired" do
56
56
  auth = subject.new(client_id, client_secret).authorize!
57
57
 
58
- allow(Time).to receive(:now).and_return(auth.expires_in + 1)
58
+ allow(Time).to receive(:now).and_return(auth.expires_at + 1)
59
59
  expect(auth.authorized?).to be false
60
60
  end
61
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exact_target_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ronie Uliana
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-23 00:00:00.000000000 Z
11
+ date: 2016-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday