eod_data_client 0.1.0 → 0.2.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/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/eod_data.gemspec +2 -0
- data/lib/eod_data/client.rb +17 -7
- data/lib/eod_data/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 145a2149ccec4c8c6681f03a7de2fb0bb30991c995e0dbe1570905d96323e8c0
|
4
|
+
data.tar.gz: d80cdb1ebc9488c6f58cb35f79e5b50e61efb18077c26330d761af8a3470927b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 731e7e5235ca1fa6e9ca9bc58ba085ef1c8a05d8f9afe18321e376788f80994b71d168009bb1f17fdf061b357af009838b21989c097beb743e1c9f8bcda64c25
|
7
|
+
data.tar.gz: 729109b02d5306c81343942a774935331ffb7a0af10a9d668194eda55892cdc97be567252b29854b6bcb1f991de4283fec989b21e748c84036d366ac66ebbe71
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
[](https://badge.fury.io/rb/eod_data_client)
|
1
2
|
[](https://circleci.com/gh/westernmilling/eod_data)
|
2
3
|
[](https://codeclimate.com/github/westernmilling/eod_data/maintainability)
|
3
4
|
[](https://codeclimate.com/github/westernmilling/eod_data/test_coverage)
|
data/eod_data.gemspec
CHANGED
@@ -5,6 +5,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
require 'eod_data/version'
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
+
# Not eod_data because this already exists here...
|
9
|
+
# https://rubygems.org/gems/eod_data
|
8
10
|
spec.name = 'eod_data_client'
|
9
11
|
spec.version = EODData::VERSION
|
10
12
|
spec.authors = ['Joseph Bridgwater-Rowe']
|
data/lib/eod_data/client.rb
CHANGED
@@ -8,9 +8,9 @@ module EODData
|
|
8
8
|
attr_accessor :base_url,
|
9
9
|
:logger,
|
10
10
|
:password,
|
11
|
+
:price_conversion_class_names,
|
11
12
|
:proxy_url,
|
12
13
|
:request_type,
|
13
|
-
:symbol_price_uoms,
|
14
14
|
:username
|
15
15
|
|
16
16
|
# ```ruby
|
@@ -18,9 +18,9 @@ module EODData
|
|
18
18
|
# config.base_url = 'http://localhost:3000'
|
19
19
|
# config.logger = Logger.new(STDOUT)
|
20
20
|
# config.password = 'password'
|
21
|
-
# config.
|
22
|
-
# ZC: '
|
23
|
-
# ZM: '
|
21
|
+
# config.price_conversion_class_names = {
|
22
|
+
# ZC: 'OriginalPrice'
|
23
|
+
# ZM: 'TonPrice'
|
24
24
|
# }
|
25
25
|
# config.username = 'username'
|
26
26
|
# end
|
@@ -111,7 +111,7 @@ module EODData
|
|
111
111
|
}
|
112
112
|
end
|
113
113
|
|
114
|
-
class
|
114
|
+
class OriginalPrice # :nodoc:
|
115
115
|
def initialize(price)
|
116
116
|
@price = price
|
117
117
|
end
|
@@ -121,6 +121,16 @@ module EODData
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
+
class CentsPerPoundPrice # :nodoc:
|
125
|
+
def initialize(price)
|
126
|
+
@price = price
|
127
|
+
end
|
128
|
+
|
129
|
+
def call
|
130
|
+
@price.to_f / 100
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
124
134
|
class BushelPrice # :nodoc:
|
125
135
|
def initialize(price)
|
126
136
|
@price = price
|
@@ -151,7 +161,7 @@ module EODData
|
|
151
161
|
@result_class ||= begin
|
152
162
|
result_class_name = self.class.name.sub('Response', 'Result')
|
153
163
|
|
154
|
-
Object.const_get(
|
164
|
+
Object.const_get(result_class_name)
|
155
165
|
end
|
156
166
|
end
|
157
167
|
|
@@ -222,7 +232,7 @@ module EODData
|
|
222
232
|
converter_klass = Object.const_get(
|
223
233
|
[
|
224
234
|
'EODData::Client',
|
225
|
-
|
235
|
+
EODData::Client.price_conversion_class_names[symbol_symbol]
|
226
236
|
].join('::')
|
227
237
|
)
|
228
238
|
|
data/lib/eod_data/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eod_data_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joseph Bridgwater-Rowe
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -164,7 +164,7 @@ dependencies:
|
|
164
164
|
- - '='
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: 3.8.0
|
167
|
-
description:
|
167
|
+
description:
|
168
168
|
email:
|
169
169
|
- joe@westernmilling.com
|
170
170
|
executables:
|
@@ -199,7 +199,7 @@ homepage: https://github.com/westernmilling/eod_data
|
|
199
199
|
licenses:
|
200
200
|
- MIT
|
201
201
|
metadata: {}
|
202
|
-
post_install_message:
|
202
|
+
post_install_message:
|
203
203
|
rdoc_options: []
|
204
204
|
require_paths:
|
205
205
|
- lib
|
@@ -214,8 +214,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
214
214
|
- !ruby/object:Gem::Version
|
215
215
|
version: '0'
|
216
216
|
requirements: []
|
217
|
-
rubygems_version: 3.0.
|
218
|
-
signing_key:
|
217
|
+
rubygems_version: 3.0.8
|
218
|
+
signing_key:
|
219
219
|
specification_version: 4
|
220
220
|
summary: EODData Web Service Client
|
221
221
|
test_files: []
|