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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d9c7fd4e2fe86f227edb7edbb04b85c0903561b
4
- data.tar.gz: eff2f86bd23cb785a91d66b9e98805004bf4aa4d
3
+ metadata.gz: 98455ac61ce764512f8f167d6bef92058f31f46e
4
+ data.tar.gz: d67cc009e460e8e65e310a496fa19e0449845cb0
5
5
  SHA512:
6
- metadata.gz: d7c315cdf8937d65339ad9991f3bb982e5c7d2728ad798425a17a2e902464ce1bb68a90b9425ed2182bf402cc750a8aa70921de7655d0f3ccb59418e68a8bf0f
7
- data.tar.gz: 4b4aaa530fb18598add85812fafa56b67d4fc0cb3ce5d15ec35a7be0934c0ef2ac93bbc151548a88f3568996c1d6625f64b43f0aa1c02e813bf3246113659ca6
6
+ metadata.gz: c32558215dc09b6c158a3f87528d91e8778157e9ea396f8ba9fa2a1501a0bdbe88e4ee85d1638123dfd062f6af67a1e44557a832ec72e8d1b54e38bd12288939
7
+ data.tar.gz: 1e228e41f956f273ddf2ebba289269e48d36b5a8aa436be436e48f42a3ee5197dbca095431fa432b429ac7d4572a42f9db650902cdf5abe6fadc64b1601488df
@@ -0,0 +1 @@
1
+ ruby 2.3.1
@@ -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
@@ -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
 
@@ -7,6 +7,7 @@ module QuoineClient
7
7
  attribute :user_secret, String
8
8
 
9
9
  api_action :list_products
10
+ api_action :list_exchange_rates, args: [:product_id]
10
11
  api_action :get_product, args: [:product_id]
11
12
  api_action :get_order_book, args: [:product_id]
12
13
 
@@ -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,13 @@
1
+ module QuoineClient
2
+ class ListExchangeRatesRequest < BaseRequest
3
+
4
+ attribute :product_id, String
5
+
6
+ private
7
+
8
+ def path
9
+ "/products/:product_id"
10
+ end
11
+
12
+ end
13
+ 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
@@ -1,3 +1,3 @@
1
1
  module QuoineClient
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  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.2.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-08-20 00:00:00.000000000 Z
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.6.10
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