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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tcgplayer_api.rb +4 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5476cb405b31b27446b25a53e8cdbd9640f86ad4
4
- data.tar.gz: 5d1b8620722c5398c8e58e13e7bea1aa4cfbd424
3
+ metadata.gz: ebb110e71f6ccd18923471377d7784747e612e0a
4
+ data.tar.gz: 987e0409d3eeeb389c35895060fe79418b693437
5
5
  SHA512:
6
- metadata.gz: 6c667b11268e11970e477fb570d7ba1c038d5515c738c24a25c8ee5fc25f33f6f79803156545714d7b18b1654add2cdff89ffe74b73ebf8e74478216740a3de0
7
- data.tar.gz: 0e8809e2d132e56721f0444208ac908a3589679318f9fd4e84350990a3aef83fda2d886a849cdd23acb587d5e3040cc504b87ea067df2aefbd451dff70be0fef
6
+ metadata.gz: 3c18748c03432deade4b5cb5dba21506bab33af7870e1e436fc82cc21849880c6c432e5c4bea2f81889e30ccc9af04a202d87082523b220cff07bf0308008d43
7
+ data.tar.gz: 038aa6d58cf0396409a50612d917275b35cd7a1f381b4e4add1ff6b67a274ac19589ecb619c967a45419e0406c5f1eade67d97289cd1681f479fbe7cc5951de9
@@ -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.2'
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] = @partner_key || 'TCGTEST'
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.2
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-12 00:00:00.000000000 Z
11
+ date: 2015-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport