tcgplayer_api 0.0.1 → 0.0.2
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 +6 -2
- 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: 5476cb405b31b27446b25a53e8cdbd9640f86ad4
|
4
|
+
data.tar.gz: 5d1b8620722c5398c8e58e13e7bea1aa4cfbd424
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c667b11268e11970e477fb570d7ba1c038d5515c738c24a25c8ee5fc25f33f6f79803156545714d7b18b1654add2cdff89ffe74b73ebf8e74478216740a3de0
|
7
|
+
data.tar.gz: 0e8809e2d132e56721f0444208ac908a3589679318f9fd4e84350990a3aef83fda2d886a849cdd23acb587d5e3040cc504b87ea067df2aefbd451dff70be0fef
|
data/lib/tcgplayer_api.rb
CHANGED
@@ -2,11 +2,15 @@ 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.2'
|
6
6
|
|
7
7
|
class << self
|
8
8
|
BASE_URL = 'http://partner.tcgplayer.com/x3'
|
9
9
|
|
10
|
+
def partner_key=(pk)
|
11
|
+
@partner_key = pk
|
12
|
+
end
|
13
|
+
|
10
14
|
# Fetch High/Mid/Low prices for the given card. If set_name is excluded,
|
11
15
|
# returns the cheapest printing across all sets.
|
12
16
|
def price_points(card_name, set_name=nil)
|
@@ -25,7 +29,7 @@ class TCGplayerAPI
|
|
25
29
|
private
|
26
30
|
|
27
31
|
def get(endpoint, params)
|
28
|
-
params[:pk] = 'TCGTEST'
|
32
|
+
params[:pk] = @partner_key || 'TCGTEST'
|
29
33
|
encoded_params = '?' + URI.encode_www_form(params)
|
30
34
|
url = [BASE_URL, endpoint, encoded_params].join
|
31
35
|
Hash.from_xml open(url)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabe Smith
|
@@ -11,7 +11,7 @@ cert_chain: []
|
|
11
11
|
date: 2015-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|