quoine_client 0.2.0 → 0.3.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/.tool-versions +1 -0
- data/CHANGELOG.md +4 -0
- data/PULL_REQUEST_TEMPLATE +18 -0
- data/lib/quoine_client.rb +3 -0
- data/lib/quoine_client/client.rb +1 -0
- data/lib/quoine_client/models/exchange_rate.rb +14 -0
- data/lib/quoine_client/requests/list_exchange_rates_request.rb +13 -0
- data/lib/quoine_client/responses/list_exchange_rates_response.rb +16 -0
- data/lib/quoine_client/version.rb +1 -1
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98455ac61ce764512f8f167d6bef92058f31f46e
|
4
|
+
data.tar.gz: d67cc009e460e8e65e310a496fa19e0449845cb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c32558215dc09b6c158a3f87528d91e8778157e9ea396f8ba9fa2a1501a0bdbe88e4ee85d1638123dfd062f6af67a1e44557a832ec72e8d1b54e38bd12288939
|
7
|
+
data.tar.gz: 1e228e41f956f273ddf2ebba289269e48d36b5a8aa436be436e48f42a3ee5197dbca095431fa432b429ac7d4572a42f9db650902cdf5abe6fadc64b1601488df
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.3.1
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
+
## [0.3.0] - 2017-11-09
|
8
|
+
### Added
|
9
|
+
- Added `client.list_exchange_rates` quoine client method
|
10
|
+
|
7
11
|
## [0.2.0] - 2017-08-19
|
8
12
|
### Added
|
9
13
|
- Factories for OrderBook, Product, Order
|
@@ -0,0 +1,18 @@
|
|
1
|
+
## Description
|
2
|
+
Describe your changes made in the context of a user/technical user.
|
3
|
+
Ex. 1 - This fixes the "Download CSV" button
|
4
|
+
Ex. 2 - Refactor in preparation for embedding transaction details
|
5
|
+
Ex. 3 - Migrating the old senders to the new table
|
6
|
+
|
7
|
+
## Pivotal Story
|
8
|
+
Place a link to the Pivotal Task:
|
9
|
+
Ex: https://www.pivotaltracker.com/story/show/0123456789
|
10
|
+
|
11
|
+
## Pull Request Changes
|
12
|
+
List changes made in the context of a developer.
|
13
|
+
Ex:
|
14
|
+
- Added new model
|
15
|
+
- Change views
|
16
|
+
|
17
|
+
## Screenshots (optional)
|
18
|
+
Take screenshots whenever there are UI changes
|
data/lib/quoine_client.rb
CHANGED
@@ -11,12 +11,15 @@ require "quoine_client/models/base_model"
|
|
11
11
|
require "quoine_client/models/product"
|
12
12
|
require "quoine_client/models/order"
|
13
13
|
require "quoine_client/models/order_book"
|
14
|
+
require "quoine_client/models/exchange_rate"
|
14
15
|
require "quoine_client/requests/base_request"
|
15
16
|
require "quoine_client/requests/list_products_request"
|
17
|
+
require "quoine_client/requests/list_exchange_rates_request"
|
16
18
|
require "quoine_client/requests/get_order_book_request"
|
17
19
|
require "quoine_client/requests/get_product_request"
|
18
20
|
require "quoine_client/responses/base_response"
|
19
21
|
require "quoine_client/responses/list_products_response"
|
22
|
+
require "quoine_client/responses/list_exchange_rates_response"
|
20
23
|
require "quoine_client/responses/get_order_book_response"
|
21
24
|
require "quoine_client/responses/get_product_response"
|
22
25
|
|
data/lib/quoine_client/client.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
module QuoineClient
|
2
|
+
class ExchangeRate < BaseModel
|
3
|
+
attribute :base_currency, String
|
4
|
+
attribute :market_bid, Float
|
5
|
+
attribute :market_ask, Float
|
6
|
+
attribute :mid_rate, Float, default: :default_mid_rate, lazy: true
|
7
|
+
|
8
|
+
private
|
9
|
+
|
10
|
+
def default_mid_rate
|
11
|
+
(market_bid + market_ask) / 2.0
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module QuoineClient
|
2
|
+
class ListExchangeRatesResponse < BaseResponse
|
3
|
+
attribute(
|
4
|
+
:exchange_rates,
|
5
|
+
QuoineClient::ExchangeRate,
|
6
|
+
lazy: true,
|
7
|
+
default: :default_exchange_rate
|
8
|
+
)
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def default_exchange_rate
|
13
|
+
QuoineClient::ExchangeRate.new(JSON.parse(body))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quoine_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- israelkeys
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-11-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: api_client_base
|
@@ -178,9 +178,11 @@ files:
|
|
178
178
|
- ".gitignore"
|
179
179
|
- ".rspec"
|
180
180
|
- ".ruby-version"
|
181
|
+
- ".tool-versions"
|
181
182
|
- ".travis.yml"
|
182
183
|
- CHANGELOG.md
|
183
184
|
- Gemfile
|
185
|
+
- PULL_REQUEST_TEMPLATE
|
184
186
|
- README.md
|
185
187
|
- Rakefile
|
186
188
|
- bin/console
|
@@ -189,16 +191,19 @@ files:
|
|
189
191
|
- lib/quoine_client/client.rb
|
190
192
|
- lib/quoine_client/factories.rb
|
191
193
|
- lib/quoine_client/models/base_model.rb
|
194
|
+
- lib/quoine_client/models/exchange_rate.rb
|
192
195
|
- lib/quoine_client/models/order.rb
|
193
196
|
- lib/quoine_client/models/order_book.rb
|
194
197
|
- lib/quoine_client/models/product.rb
|
195
198
|
- lib/quoine_client/requests/base_request.rb
|
196
199
|
- lib/quoine_client/requests/get_order_book_request.rb
|
197
200
|
- lib/quoine_client/requests/get_product_request.rb
|
201
|
+
- lib/quoine_client/requests/list_exchange_rates_request.rb
|
198
202
|
- lib/quoine_client/requests/list_products_request.rb
|
199
203
|
- lib/quoine_client/responses/base_response.rb
|
200
204
|
- lib/quoine_client/responses/get_order_book_response.rb
|
201
205
|
- lib/quoine_client/responses/get_product_response.rb
|
206
|
+
- lib/quoine_client/responses/list_exchange_rates_response.rb
|
202
207
|
- lib/quoine_client/responses/list_products_response.rb
|
203
208
|
- lib/quoine_client/version.rb
|
204
209
|
- quoine_client.gemspec
|
@@ -223,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
228
|
version: '0'
|
224
229
|
requirements: []
|
225
230
|
rubyforge_project:
|
226
|
-
rubygems_version: 2.
|
231
|
+
rubygems_version: 2.5.1
|
227
232
|
signing_key:
|
228
233
|
specification_version: 4
|
229
234
|
summary: Ruby wrapper for BloomNet Center's API
|