sports_south 2.0.25 → 2.0.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sports_south/inventory.rb +44 -0
- data/lib/sports_south/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e2ce457724bf91d9c91c9e86e80773095fbb063
|
4
|
+
data.tar.gz: 8332788e193a72dff49fa3eda16fe099cb89bdea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8062b3074bf027bd825a57107ded8e4d68520cb1990baba3ab8084ca86bbd1c2bf19ba22bf331ff42aae9f5365baa32164470b816ed9a77b4f0edfa4f3d3ef23
|
7
|
+
data.tar.gz: 48c848798feb86ff44747bfbfaef47c6e97eb37a924170ba9a15ad1d1781d7478a4c35f88a8cb18f08fa8dc9622bd3f00577f90002ede3184984d56e573bec26
|
@@ -55,6 +55,50 @@ module SportsSouth
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
+
def self.quantity(chunk_size = 100, options = {}, &block)
|
59
|
+
requires!(options, :username, :password)
|
60
|
+
|
61
|
+
if options[:last_updated].present?
|
62
|
+
options[:last_updated] = options[:last_updated].to_s("yyyy-MM-ddTHH:mm:sszzz")
|
63
|
+
else
|
64
|
+
options[:last_updated] = '1990-09-25T14:15:47-04:00'
|
65
|
+
end
|
66
|
+
|
67
|
+
options[:last_item] ||= '-1'
|
68
|
+
|
69
|
+
new(options).all(chunk_size, &block)
|
70
|
+
end
|
71
|
+
|
72
|
+
def quantity(chunk_size, &block)
|
73
|
+
chunker = SportsSouth::Chunker.new(chunk_size)
|
74
|
+
http, request = get_http_and_request(API_URL, '/IncrementalOnhandUpdate')
|
75
|
+
|
76
|
+
request.set_form_data(form_params = form_params(@options).merge({
|
77
|
+
SinceDateTime: @options[:last_updated],
|
78
|
+
LastItem: @options[:last_item].to_s
|
79
|
+
}))
|
80
|
+
|
81
|
+
response = http.request(request)
|
82
|
+
xml_doc = Nokogiri::XML(sanitize_response(response))
|
83
|
+
|
84
|
+
xml_doc.css('Onhand').map do |item|
|
85
|
+
if chunker.is_full?
|
86
|
+
yield(chunker.chunk)
|
87
|
+
|
88
|
+
chunker.reset!
|
89
|
+
else
|
90
|
+
chunker.add({
|
91
|
+
item_identifier: content_for(node, 'I'),
|
92
|
+
quantity: content_for(node, 'Q').to_i
|
93
|
+
})
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
if chunker.chunk.count > 0
|
98
|
+
yield(chunker.chunk)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
58
102
|
def get(item_identifier)
|
59
103
|
http, request = get_http_and_request(API_URL, '/OnhandInquiry')
|
60
104
|
|
data/lib/sports_south/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sports_south
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
version: '0'
|
148
148
|
requirements: []
|
149
149
|
rubyforge_project:
|
150
|
-
rubygems_version: 2.
|
150
|
+
rubygems_version: 2.5.1
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: Sports South API Ruby library.
|