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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tcgplayer_api.rb +6 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4708223da1413c5688b1955d9a30c2c6d74642df
4
- data.tar.gz: 66f027a8cf2e1bc15c4f14a86ab51f88ec3b1222
3
+ metadata.gz: 5476cb405b31b27446b25a53e8cdbd9640f86ad4
4
+ data.tar.gz: 5d1b8620722c5398c8e58e13e7bea1aa4cfbd424
5
5
  SHA512:
6
- metadata.gz: e571494df04216947eda482d277608c42327ab2be0e5497b95e697fa1b57e15b5496670e677b58308d31eda1315ab30b0c08d0e329142dd31b83a891d5f23696
7
- data.tar.gz: 013a2ad1169a03d4b18d5644ec94c80eb87d43f0d6e95c37c4663bde4bfd17c4a3a85af2d49152c317ab2b2d0ffb8fd9b5c3b042f8fb18168bdfc1614a31c76c
6
+ metadata.gz: 6c667b11268e11970e477fb570d7ba1c038d5515c738c24a25c8ee5fc25f33f6f79803156545714d7b18b1654add2cdff89ffe74b73ebf8e74478216740a3de0
7
+ data.tar.gz: 0e8809e2d132e56721f0444208ac908a3589679318f9fd4e84350990a3aef83fda2d886a849cdd23acb587d5e3040cc504b87ea067df2aefbd451dff70be0fef
@@ -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.1'
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.1
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: nokogiri
14
+ name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="