tangocard 0.2.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/tangocard/raas.rb +10 -2
- data/lib/tangocard/version.rb +1 -1
- data/lib/tangocard.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTEwNTdhNmNmOWU4YzMzYTA3NjgxZWM4YjUyMmU4N2JmM2M3NzNjZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzZjNTllZjZhYmFmMTI0NmU3MjJkNmZkYTM0OGI5ZWU4YTdhMDgwMQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTZkZTI5YmI4NjJiZDdlNzMzNTcxODA0Mzg5Yjc2ZThmY2FlMjFiMTU2NjBm
|
10
|
+
OTJlNjllZWRlNTBjYWEzMDU2MGRlNTkyYWI0ZjZiNmE5MDYxNjRkYzY4ZGQ1
|
11
|
+
Mjg3OWUxMjcwNjY3NDI2MDUxMTVjMTM4YzE1Nzc1YmMzOTA0YTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NWRlYjgxMDA5NDVhODMxNzViMTY2Mjg0NWU2M2FlYzYzZGE3NmI5ZWE3YTdh
|
14
|
+
Y2U4NGIxNTU3YjQyNDhmMWFjYjRlOTFkZmE5NDdlNzAxOGE2NjJhMWNjMjZk
|
15
|
+
YzI1YmY2ZDE5OTUxYjRlMGJmMjEzZGM3ZWRiOWRkMjhiM2JlYjA=
|
data/lib/tangocard/raas.rb
CHANGED
@@ -10,7 +10,7 @@ class Tangocard::Raas
|
|
10
10
|
# Arguments:
|
11
11
|
# params: (Hash - see https://github.com/tangocarddev/RaaS#create-a-new-platform-account for details)
|
12
12
|
def self.create_account(params)
|
13
|
-
Tangocard::Response.new(post(endpoint + 'accounts', {:body => params.to_json}.merge(basic_auth_param)))
|
13
|
+
Tangocard::Response.new(post(endpoint + '/accounts', {:body => params.to_json}.merge(basic_auth_param)))
|
14
14
|
end
|
15
15
|
|
16
16
|
# Gets account details. Returns Tangocard::Response object.
|
@@ -46,7 +46,11 @@ class Tangocard::Raas
|
|
46
46
|
# Arguments:
|
47
47
|
# none
|
48
48
|
def self.rewards_index
|
49
|
-
Tangocard
|
49
|
+
if Tangocard.configuration.use_cache
|
50
|
+
@@rewards_response ||= Tangocard::Response.new(get(endpoint + '/rewards', basic_auth_param))
|
51
|
+
else
|
52
|
+
Tangocard::Response.new(get(endpoint + '/rewards', basic_auth_param))
|
53
|
+
end
|
50
54
|
end
|
51
55
|
|
52
56
|
# Create an order. Returns Tangocard::Response object.
|
@@ -93,6 +97,10 @@ class Tangocard::Raas
|
|
93
97
|
Tangocard::Response.new(get(endpoint + "/orders#{query_string}", basic_auth_param))
|
94
98
|
end
|
95
99
|
|
100
|
+
def self.clear_cache!
|
101
|
+
@@rewards_response = nil
|
102
|
+
end
|
103
|
+
|
96
104
|
private
|
97
105
|
|
98
106
|
def self.basic_auth_param
|
data/lib/tangocard/version.rb
CHANGED
data/lib/tangocard.rb
CHANGED
@@ -4,7 +4,7 @@ require 'ostruct'
|
|
4
4
|
|
5
5
|
module Tangocard
|
6
6
|
class Configuration
|
7
|
-
attr_accessor :name, :key, :base_uri, :default_brands, :local_images, :sku_blacklist
|
7
|
+
attr_accessor :name, :key, :base_uri, :default_brands, :local_images, :sku_blacklist, :use_cache
|
8
8
|
|
9
9
|
def initialize
|
10
10
|
self.name = nil
|
@@ -13,6 +13,7 @@ module Tangocard
|
|
13
13
|
self.default_brands = ['Tango Card']
|
14
14
|
self.local_images = {}
|
15
15
|
self.sku_blacklist = []
|
16
|
+
self.use_cache = true
|
16
17
|
end
|
17
18
|
end
|
18
19
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tangocard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raphael Crawford-Marks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|