tangocard 3.2.1 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/tangocard.rb +1 -1
- data/lib/tangocard/brand.rb +4 -13
- data/lib/tangocard/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb29e103e970f53672c6f453da330bd1bf0b5d8e
|
4
|
+
data.tar.gz: abbaa0d59df394630be3b979fc04f5ecbd0137b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f89c1dbaedec7244c84fb198a52653703daacd38be65b4e50eef3d655aa7e6d4330c3b168aaee47b7a48d1a030f7a56b12f68b3db7dce39359c2c15b84ae739
|
7
|
+
data.tar.gz: f74a4d66608ae73067c694a0cf4a8f45f6cbdd4b28adc104860f590c151adcd7a56c2d3ea3126fad1e0d845681c1eb03f7dd097545c0cbaa74e0946bebea32b8
|
data/README.md
CHANGED
data/lib/tangocard.rb
CHANGED
@@ -9,7 +9,7 @@ module Tangocard
|
|
9
9
|
def initialize
|
10
10
|
self.name = nil
|
11
11
|
self.key = nil
|
12
|
-
self.base_uri =
|
12
|
+
self.base_uri = 'https://sandbox.tangocard.com'
|
13
13
|
self.default_brands = ['Tango Card']
|
14
14
|
self.local_images = {}
|
15
15
|
self.sku_blacklist = []
|
data/lib/tangocard/brand.rb
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
class Tangocard::Brand
|
2
2
|
attr_reader :description, :rewards
|
3
|
-
@result = nil
|
4
|
-
@brands = nil
|
5
|
-
@default_brands = nil
|
6
|
-
@brand_finder = {}
|
7
3
|
|
8
4
|
# Clear all cached responses. Next request for brand info will pull fresh from the Tango Card API.
|
9
5
|
#
|
@@ -14,11 +10,7 @@ class Tangocard::Brand
|
|
14
10
|
# Arguments:
|
15
11
|
# none
|
16
12
|
def self.clear_cache!
|
17
|
-
|
18
|
-
@brands = nil
|
19
|
-
@default_brands = nil
|
20
|
-
@brand_finder = {}
|
21
|
-
true
|
13
|
+
Tangocard::Raas.clear_cache!
|
22
14
|
end
|
23
15
|
|
24
16
|
# Return an array of all brands.
|
@@ -30,8 +22,7 @@ class Tangocard::Brand
|
|
30
22
|
# Arguments:
|
31
23
|
# none
|
32
24
|
def self.all
|
33
|
-
|
34
|
-
@brands ||= @result['brands'].map{|p| Tangocard::Brand.new(p)}
|
25
|
+
Tangocard::Raas.rewards_index.parsed_response['brands'].map{|p| Tangocard::Brand.new(p)}
|
35
26
|
end
|
36
27
|
|
37
28
|
# Return an array of default brands. Must set default_brands in your Tangocard initializer (see README).
|
@@ -43,7 +34,7 @@ class Tangocard::Brand
|
|
43
34
|
# Arguments:
|
44
35
|
# none
|
45
36
|
def self.default_brands
|
46
|
-
|
37
|
+
self.all.select{|b| Tangocard.configuration.default_brands.include?(b.description)}
|
47
38
|
end
|
48
39
|
|
49
40
|
# Find a brand by its :description field.
|
@@ -59,7 +50,7 @@ class Tangocard::Brand
|
|
59
50
|
# Arguments:
|
60
51
|
# brand_name: (String)
|
61
52
|
def self.find(brand_name)
|
62
|
-
|
53
|
+
self.all.select{|b| b.description == brand_name}.first
|
63
54
|
end
|
64
55
|
|
65
56
|
def initialize(params)
|
data/lib/tangocard/version.rb
CHANGED
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: 3.2.
|
4
|
+
version: 3.2.2
|
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: 2015-
|
11
|
+
date: 2015-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
125
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
126
|
+
rubygems_version: 2.4.3
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: Ruby Wrapper for Tango Card RaaS API.
|