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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmM1NTFkZDNkODRmYjcwMWVhMjE2ZDgyNzk1YTlmMGY3OGI3YzU3Mw==
4
+ OTEwNTdhNmNmOWU4YzMzYTA3NjgxZWM4YjUyMmU4N2JmM2M3NzNjZA==
5
5
  data.tar.gz: !binary |-
6
- ODg1MzZjZWI4ODhhYTAxNzY4YjkwZTc1Yjg1OTA3ZWM5YzhkOGRiNA==
6
+ NzZjNTllZjZhYmFmMTI0NmU3MjJkNmZkYTM0OGI5ZWU4YTdhMDgwMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZWRjMjcyMDM2ZWIzNjM4YTFlZDIzMjlkNWNmYmU3MzJmOWQwYTJjN2Q5ZDY4
10
- MGQxZDQwMWY1M2I4OGRiMzY4MmJmZDg1YWRjZDMzNmZjN2Q0MDVkZDYxNTE2
11
- NDAzM2YyM2Q3NjY5NjcyNDY2MGNjZDQ4MDllZDRkNThmMWU5Njk=
9
+ NTZkZTI5YmI4NjJiZDdlNzMzNTcxODA0Mzg5Yjc2ZThmY2FlMjFiMTU2NjBm
10
+ OTJlNjllZWRlNTBjYWEzMDU2MGRlNTkyYWI0ZjZiNmE5MDYxNjRkYzY4ZGQ1
11
+ Mjg3OWUxMjcwNjY3NDI2MDUxMTVjMTM4YzE1Nzc1YmMzOTA0YTc=
12
12
  data.tar.gz: !binary |-
13
- YzViZDExMGU1OGViY2NiZmY3ZTQ1MjQzODEwOTRhNzk1NjExMTZmYWQ0ZDg5
14
- MGEzZGIzOTFhNDE5M2Q3NjY3ZDM0YjY0N2FkODJjYTQwYTI5NWZiMmQwZGJl
15
- ODE5YzQyN2JkMTA4YjZmODVjYTYxOTlmNjE1M2MyM2RjNmEwZjM=
13
+ NWRlYjgxMDA5NDVhODMxNzViMTY2Mjg0NWU2M2FlYzYzZGE3NmI5ZWE3YTdh
14
+ Y2U4NGIxNTU3YjQyNDhmMWFjYjRlOTFkZmE5NDdlNzAxOGE2NjJhMWNjMjZk
15
+ YzI1YmY2ZDE5OTUxYjRlMGJmMjEzZGM3ZWRiOWRkMjhiM2JlYjA=
@@ -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::Response.new(get(endpoint + '/rewards', basic_auth_param))
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
@@ -1,3 +1,3 @@
1
1
  module Tangocard
2
- VERSION = "0.2.2"
2
+ VERSION = "1.0.0"
3
3
  end
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.2.2
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-10-06 00:00:00.000000000 Z
11
+ date: 2013-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty