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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0da35ab665550b45ef0f2e15f8646546a771ff5f06e57305fd8ddd2cd94d9e8e
4
- data.tar.gz: 8a787344921d862b47d83c0838406e0fc41a2b3ef39f756fba3008cff21138ce
3
+ metadata.gz: 145a2149ccec4c8c6681f03a7de2fb0bb30991c995e0dbe1570905d96323e8c0
4
+ data.tar.gz: d80cdb1ebc9488c6f58cb35f79e5b50e61efb18077c26330d761af8a3470927b
5
5
  SHA512:
6
- metadata.gz: 435f1448ddfa0286b24e20cc0dfb6bb24325c39671a03a19f6934fbab589d8d8434510c1a8d7cfbe24f6f2721a57c57ae3f95be13976b65580cac8edf66bac29
7
- data.tar.gz: c0fb997bae54b3889d77008296a31b377e6d5cc7215c29a042a9a81c43d82c2dc44f7f755d9b7b2569faa9959385041e4e5a04900105d634a7c1413cd10b8a03
6
+ metadata.gz: 731e7e5235ca1fa6e9ca9bc58ba085ef1c8a05d8f9afe18321e376788f80994b71d168009bb1f17fdf061b357af009838b21989c097beb743e1c9f8bcda64c25
7
+ data.tar.gz: 729109b02d5306c81343942a774935331ffb7a0af10a9d668194eda55892cdc97be567252b29854b6bcb1f991de4283fec989b21e748c84036d366ac66ebbe71
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eod_data_client (0.1.0)
4
+ eod_data_client (0.2.0)
5
5
  dotenv (= 2.7.5)
6
6
  gli (= 2.19.0)
7
7
  savon (= 2.12.0)
data/README.md CHANGED
@@ -1,3 +1,4 @@
1
+ [![Gem Version](https://badge.fury.io/rb/eod_data_client.svg)](https://badge.fury.io/rb/eod_data_client)
1
2
  [![CircleCI](https://circleci.com/gh/westernmilling/eod_data.svg?style=svg&circle-token=a84f70c542ef4cacffe34d412933c62d4a9998b6)](https://circleci.com/gh/westernmilling/eod_data)
2
3
  [![Maintainability](https://api.codeclimate.com/v1/badges/c2db47a62be7a8e73282/maintainability)](https://codeclimate.com/github/westernmilling/eod_data/maintainability)
3
4
  [![Test Coverage](https://api.codeclimate.com/v1/badges/c2db47a62be7a8e73282/test_coverage)](https://codeclimate.com/github/westernmilling/eod_data/test_coverage)
@@ -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']
@@ -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.symbol_price_uoms = {
22
- # ZC: 'Bushel'
23
- # ZM: 'Ton'
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 TonPrice # :nodoc:
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("EODData::Client::#{result_class_name}")
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
- "#{EODData::Client.symbol_price_uoms[symbol_symbol]}Price"
235
+ EODData::Client.price_conversion_class_names[symbol_symbol]
226
236
  ].join('::')
227
237
  )
228
238
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EODData
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
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.1.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-01-28 00:00:00.000000000 Z
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.6
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: []