tcgplayer_api 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tcgplayer_api.rb +4 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebb110e71f6ccd18923471377d7784747e612e0a
|
4
|
+
data.tar.gz: 987e0409d3eeeb389c35895060fe79418b693437
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c18748c03432deade4b5cb5dba21506bab33af7870e1e436fc82cc21849880c6c432e5c4bea2f81889e30ccc9af04a202d87082523b220cff07bf0308008d43
|
7
|
+
data.tar.gz: 038aa6d58cf0396409a50612d917275b35cd7a1f381b4e4add1ff6b67a274ac19589ecb619c967a45419e0406c5f1eade67d97289cd1681f479fbe7cc5951de9
|
data/lib/tcgplayer_api.rb
CHANGED
@@ -2,15 +2,12 @@ require 'active_support/core_ext/hash/conversions'
|
|
2
2
|
require 'open-uri'
|
3
3
|
|
4
4
|
class TCGplayerAPI
|
5
|
-
VERSION = '0.0.
|
5
|
+
VERSION = '0.0.3'
|
6
6
|
|
7
7
|
class << self
|
8
|
+
attr_accessor :partner_key, :logger
|
8
9
|
BASE_URL = 'http://partner.tcgplayer.com/x3'
|
9
10
|
|
10
|
-
def partner_key=(pk)
|
11
|
-
@partner_key = pk
|
12
|
-
end
|
13
|
-
|
14
11
|
# Fetch High/Mid/Low prices for the given card. If set_name is excluded,
|
15
12
|
# returns the cheapest printing across all sets.
|
16
13
|
def price_points(card_name, set_name=nil)
|
@@ -29,9 +26,10 @@ class TCGplayerAPI
|
|
29
26
|
private
|
30
27
|
|
31
28
|
def get(endpoint, params)
|
32
|
-
params[:pk] =
|
29
|
+
params[:pk] = partner_key || 'TCGTEST'
|
33
30
|
encoded_params = '?' + URI.encode_www_form(params)
|
34
31
|
url = [BASE_URL, endpoint, encoded_params].join
|
32
|
+
@logger.info "GET #{url}" if @logger
|
35
33
|
Hash.from_xml open(url)
|
36
34
|
end
|
37
35
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tcgplayer_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabe Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|