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 +4 -4
- data/lib/sunlight_api/version.rb +1 -1
- data/lib/sunlight_api.rb +9 -0
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a76ef01693fb9f80ab9a585fe39394c57a4c1f63
|
|
4
|
+
data.tar.gz: 7971d9810a2a4b129fc3531a028ca1f3ce0eefc3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8af9deecaeb2ba852bd4a79c32c9361af7389beec10404c338c93f473829ce51e7435a1665ea6fd14c871d32f5a8d211e3a4b6ae24e42ea28787e072f4ad01c9
|
|
7
|
+
data.tar.gz: 5438cb6526ab8e1d0258c87ebaed5aec0682514399e3fccd6f1681c9458dde5daaf2855ff89cd87629b87ba8996fc64c56d4f888fb80c92d57940296590a41af
|
data/lib/sunlight_api/version.rb
CHANGED
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
|
|
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-
|
|
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.
|
|
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:
|