economic-rest 0.2.5 → 0.2.7
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 +5 -5
- data/Gemfile.lock +4 -4
- data/lib/economic/pricing_repo.rb +15 -0
- data/lib/economic/product_group_repo.rb +0 -11
- data/lib/economic/product_repo.rb +12 -0
- data/lib/economic/rest.rb +1 -0
- data/lib/economic/rest/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bda5846955fe8abb517ad10015d12bb70075f14893c3b9af34b962502693ec75
|
4
|
+
data.tar.gz: 7fd6e3b9593968e4097d5400558ac0288771a0f663b83df7adfbc5d52ae06b8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ded25ff22ac395bad102f13c0d5f5bbb4496389b578a4888f38670ebb52928debec168242f1bd900938fc2f2a68927acf325514cb8028babc6df578d16fdb549
|
7
|
+
data.tar.gz: c72d99e9b55a2018983f54b977534c2c627ae00928504d51a0823e0df58bee55f8a980aecc35615d1b7f74a8fa0a97e609aa4f03d98313d8d03832b6897b7a32
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
economic-rest (0.2.
|
4
|
+
economic-rest (0.2.5)
|
5
5
|
rest-client
|
6
6
|
|
7
7
|
GEM
|
@@ -24,7 +24,7 @@ GEM
|
|
24
24
|
method_source (0.9.2)
|
25
25
|
mime-types (3.2.2)
|
26
26
|
mime-types-data (~> 3.2015)
|
27
|
-
mime-types-data (3.
|
27
|
+
mime-types-data (3.2019.0331)
|
28
28
|
minitest (5.11.3)
|
29
29
|
netrc (0.11.0)
|
30
30
|
public_suffix (3.0.3)
|
@@ -41,7 +41,7 @@ GEM
|
|
41
41
|
simplecov-html (0.10.2)
|
42
42
|
unf (0.1.4)
|
43
43
|
unf_ext
|
44
|
-
unf_ext (0.0.7.
|
44
|
+
unf_ext (0.0.7.6)
|
45
45
|
webmock (3.5.1)
|
46
46
|
addressable (>= 2.3.6)
|
47
47
|
crack (>= 0.3.2)
|
@@ -60,4 +60,4 @@ DEPENDENCIES
|
|
60
60
|
webmock (~> 3.5)
|
61
61
|
|
62
62
|
BUNDLED WITH
|
63
|
-
1.17.
|
63
|
+
1.17.3
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Economic
|
2
|
+
class PricingRepo < Economic::ProductRepo
|
3
|
+
def self.currency_specific_sales_prices_for(entry_number)
|
4
|
+
end_point = [superclass.endpoint_url, entry_number, 'pricing', 'currency-specific-sales-prices'].join('/')
|
5
|
+
response = test_response(RestClient.get(end_point, headers))
|
6
|
+
entry_hash = JSON.parse(response.body)
|
7
|
+
pricings = []
|
8
|
+
|
9
|
+
entry_hash['collection'].each do |pricing|
|
10
|
+
pricings.push Pricing.new(pricing)
|
11
|
+
end
|
12
|
+
pricings
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -1,15 +1,4 @@
|
|
1
1
|
module Economic
|
2
2
|
class ProductGroupRepo < Economic::BaseRepo
|
3
|
-
def self.find_products(entry_number)
|
4
|
-
end_point = [endpoint_url, entry_number, 'products'].join('/')
|
5
|
-
response = test_response(RestClient.get(end_point, headers))
|
6
|
-
entry_hash = JSON.parse(response.body)
|
7
|
-
products = []
|
8
|
-
|
9
|
-
entry_hash['collection'].each do |product|
|
10
|
-
products.push Product.new(product)
|
11
|
-
end
|
12
|
-
products
|
13
|
-
end
|
14
3
|
end
|
15
4
|
end
|
@@ -11,5 +11,17 @@ module Economic
|
|
11
11
|
end
|
12
12
|
pricings
|
13
13
|
end
|
14
|
+
|
15
|
+
def self.in_group(entry_number)
|
16
|
+
end_point = [ProductGroupRepo.endpoint_url, entry_number, 'products'].join('/')
|
17
|
+
response = test_response(RestClient.get(end_point, headers))
|
18
|
+
entry_hash = JSON.parse(response.body)
|
19
|
+
products = []
|
20
|
+
|
21
|
+
entry_hash['collection'].each do |product|
|
22
|
+
products.push Product.new(product)
|
23
|
+
end
|
24
|
+
products
|
25
|
+
end
|
14
26
|
end
|
15
27
|
end
|
data/lib/economic/rest.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: economic-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Klogborg
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- lib/economic/payment_terms.rb
|
148
148
|
- lib/economic/pdf.rb
|
149
149
|
- lib/economic/pricing.rb
|
150
|
+
- lib/economic/pricing_repo.rb
|
150
151
|
- lib/economic/product.rb
|
151
152
|
- lib/economic/product_group.rb
|
152
153
|
- lib/economic/product_group_repo.rb
|
@@ -178,8 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
179
|
- !ruby/object:Gem::Version
|
179
180
|
version: '0'
|
180
181
|
requirements: []
|
181
|
-
|
182
|
-
rubygems_version: 2.5.2.3
|
182
|
+
rubygems_version: 3.0.1
|
183
183
|
signing_key:
|
184
184
|
specification_version: 4
|
185
185
|
summary: Ruby wrapper for the e-conomic REST API, that aims at making working with
|