sunlight_api 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c76fa98bea5dcee3a8a0426170d91bd6d763df6e
4
- data.tar.gz: 1d3cb7cdec5a162f3edf3b72ecbc8ad273e8d0bc
3
+ metadata.gz: a76ef01693fb9f80ab9a585fe39394c57a4c1f63
4
+ data.tar.gz: 7971d9810a2a4b129fc3531a028ca1f3ce0eefc3
5
5
  SHA512:
6
- metadata.gz: 1ecb927f0197a3b60d6dc27c705c8ee0dea46b62b0e4436ea8021bb13e033d6deec02591990dbb28efa9ca2f559c452fafbbf58573393922211e4b36ea3461c1
7
- data.tar.gz: b00ab525b92f7df408275b29aafdd7d402dfdec0246aa76dc7d0b8383050ffe31d9322b681a22dba883bf40159e52d9bc889df028b74d5a771d432e30de1fa69
6
+ metadata.gz: 8af9deecaeb2ba852bd4a79c32c9361af7389beec10404c338c93f473829ce51e7435a1665ea6fd14c871d32f5a8d211e3a4b6ae24e42ea28787e072f4ad01c9
7
+ data.tar.gz: 5438cb6526ab8e1d0258c87ebaed5aec0682514399e3fccd6f1681c9458dde5daaf2855ff89cd87629b87ba8996fc64c56d4f888fb80c92d57940296590a41af
@@ -1,3 +1,3 @@
1
1
  module SunlightApi
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
data/lib/sunlight_api.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require "sunlight_api/version"
2
2
  require "rquest"
3
3
  require "json"
4
+ # Fix ruby's DNS lookup issues
5
+ require "resolv-replace.rb"
4
6
 
5
7
  module SunlightApi
6
8
  class Client
@@ -34,10 +36,17 @@ module SunlightApi
34
36
  request("part/#{id}")
35
37
  end
36
38
 
39
+ def product_price_breaks( id )
40
+ request("pricebreak/#{id}")
41
+ end
42
+
37
43
  def each_product( &block )
38
44
  array_of_product_ids.each do |product_id|
39
45
  product = product_info( product_id )
40
46
  next unless product
47
+ price_breaks = product_price_breaks(product_id)
48
+ price_breaks ||= []
49
+ product["PriceBreaks"] = price_breaks
41
50
  yield product
42
51
  end
43
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunlight_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Tyrel Corporation
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-05-11 00:00:00.000000000 Z
11
+ date: 2015-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -137,9 +137,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  requirements: []
139
139
  rubyforge_project:
140
- rubygems_version: 2.4.3
140
+ rubygems_version: 2.2.3
141
141
  signing_key:
142
142
  specification_version: 4
143
143
  summary: Access specifications and stock levels for sunlight supplies product line
144
144
  test_files: []
145
- has_rdoc: