economic-rest 0.2.1 → 0.2.3
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/economic/base_repo.rb +9 -1
- data/lib/economic/product_group.rb +4 -1
- data/lib/economic/product_group_repo.rb +15 -0
- data/lib/economic/rest.rb +1 -0
- data/lib/economic/rest/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da6726b14829a14829abfe2c54c95ae5dbb933bc
|
4
|
+
data.tar.gz: 54c32651c44a9890285dbaba7b63b01ddbc7edf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 386543655abadcf0d1cdd49447c392551ba1d4f67a0fdfa59dbf0c17a4c9cca6d876b1b3f57052d7e9b1c84b98824a4cc4210c81204cc2e4cf11d204b7a76dd8
|
7
|
+
data.tar.gz: 90a11c953a388ab1149c36204039d2f195670a8b936a93a810d8277d7c932cf824f80cd39218c611e3cbeb35349ecf95b533b3a3e16bf1e27bad0a93f5455007
|
data/lib/economic/base_repo.rb
CHANGED
@@ -88,7 +88,7 @@ module Economic
|
|
88
88
|
end_p = end_p.gsub('Repo', 's')
|
89
89
|
end
|
90
90
|
end_p = end_p.gsub('Journals', 'Journals-Experimental')
|
91
|
-
end_p
|
91
|
+
kebab(end_p)
|
92
92
|
end
|
93
93
|
|
94
94
|
def endpoint_url
|
@@ -100,6 +100,14 @@ module Economic
|
|
100
100
|
|
101
101
|
response
|
102
102
|
end
|
103
|
+
|
104
|
+
def kebab(string)
|
105
|
+
string.gsub(/::/, '/')
|
106
|
+
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
107
|
+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
108
|
+
.tr('_', '-')
|
109
|
+
.downcase
|
110
|
+
end
|
103
111
|
end
|
104
112
|
end
|
105
113
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Economic
|
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
|
+
end
|
15
|
+
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.3
|
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-
|
11
|
+
date: 2019-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -146,6 +146,7 @@ files:
|
|
146
146
|
- lib/economic/pdf.rb
|
147
147
|
- lib/economic/product.rb
|
148
148
|
- lib/economic/product_group.rb
|
149
|
+
- lib/economic/product_group_repo.rb
|
149
150
|
- lib/economic/product_repo.rb
|
150
151
|
- lib/economic/project.rb
|
151
152
|
- lib/economic/recipient.rb
|
@@ -175,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
176
|
version: '0'
|
176
177
|
requirements: []
|
177
178
|
rubyforge_project:
|
178
|
-
rubygems_version: 2.5.
|
179
|
+
rubygems_version: 2.5.2.3
|
179
180
|
signing_key:
|
180
181
|
specification_version: 4
|
181
182
|
summary: Ruby wrapper for the e-conomic REST API, that aims at making working with
|