bitstamp_client 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e71eda09644388a9d26214bc9cafba34c287dd78e092a5acf13bfc124a5ef6cd
4
- data.tar.gz: 940eb60767ad7e04e5f70ee9143ad17344b325a8307566db3e002fc1e6e3734b
3
+ metadata.gz: 3b8a4f622fc63947b187391a2f3cf52db990a1f793dd5cc6d832670afbbb9153
4
+ data.tar.gz: 6f22c74ebdb91f9afa9f36fddb144a752ed439451b0f9aea6886006bd0705fd5
5
5
  SHA512:
6
- metadata.gz: a3bd3720cd709b0c17bf1827ee8aed81162346e2fc2d9ed86f7e4db19ebe95fdd08fbe1c2673152beb0e1b125d44735199099b26932ebe80e848e6c9a34af2a3
7
- data.tar.gz: a13bf80119fa7eac0f315d36f3f838eb44b7422a37607db80b98475b1b129e27c53a6a0c19b9880be3b933d623b7e452717a3173567a164142e5c19ac0f33e6c
6
+ metadata.gz: 3e7f33f7f4fd5d1bd9ef0454111577eef0886d094164df6321ea560402b7c7f791b7f83917284ffaad89e709d7f6c6f14727cc5678ea6b68a33db86f80e9124c
7
+ data.tar.gz: 8576a8c6f58623a34119806c2015eb208422396751f6620c0e2da8fe56e7e9fc9dda8e622e120733a1ce19f7d010acb518be18b442dfb3591022b8531f93c406
data/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ 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
+ ## [1.1.0] - 2019-01-07
8
+ ### Fixed
9
+ - Factories updated to FactoryBot
10
+
11
+ ### Added
12
+ - `MarketOrder` `#buy` and `#sell`
13
+
7
14
  ## [1.0.1] - 2019-01-07
8
15
  ### Fixed
9
16
  - All responses are not successful when Bitstamp's response has a `status` key
@@ -41,5 +41,5 @@ Gem::Specification.new do |spec|
41
41
  spec.add_development_dependency "vcr", "~> 3.0"
42
42
  spec.add_development_dependency "webmock", "~> 2.3"
43
43
  spec.add_development_dependency "virtus-matchers", ">= 0.4.0"
44
- spec.add_development_dependency "factory_girl"
44
+ spec.add_development_dependency "factory_bot"
45
45
  end
@@ -1,19 +1,19 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
 
3
3
  factory :bitstamp_client_order_book, class: "BitstampClient::OrderBook" do
4
4
  timestamp { Time.now.to_i }
5
5
 
6
6
  bids do
7
7
  [
8
- FactoryGirl.build(:bitstamp_client_order),
9
- FactoryGirl.build(:bitstamp_client_order),
8
+ FactoryBot.build(:bitstamp_client_order),
9
+ FactoryBot.build(:bitstamp_client_order),
10
10
  ]
11
11
  end
12
12
 
13
13
  asks do
14
14
  [
15
- FactoryGirl.build(:bitstamp_client_order),
16
- FactoryGirl.build(:bitstamp_client_order),
15
+ FactoryBot.build(:bitstamp_client_order),
16
+ FactoryBot.build(:bitstamp_client_order),
17
17
  ]
18
18
  end
19
19
  end
@@ -23,4 +23,12 @@ FactoryGirl.define do
23
23
  volume { 2 }
24
24
  end
25
25
 
26
+ factory :bitstamp_client_market_order, class: "BitstampClient::MarketOrder" do
27
+ sequence(:id) {|n| n}
28
+ datetime { DateTime.now }
29
+ type { "0" }
30
+ price { 4000.99 }
31
+ amount { 0.01 }
32
+ end
33
+
26
34
  end
@@ -1,11 +1,26 @@
1
1
  module BitstampClient
2
2
  class MarketOrder < BaseModel
3
3
 
4
+ BUY_CODE = "0".freeze
5
+ SELL_CODE = "1".freeze
6
+
4
7
  attribute :id, String
5
8
  attribute :datetime, DateTime
6
9
  attribute :type, String
7
10
  attribute :price, BigDecimal
8
11
  attribute :amount, BigDecimal
12
+ attribute :buy, Boolean, default: :default_buy, lazy: true
13
+ attribute :sell, Boolean, default: :default_sell, lazy: true
14
+
15
+ private
16
+
17
+ def default_buy
18
+ type == BUY_CODE
19
+ end
20
+
21
+ def default_sell
22
+ type == SELL_CODE
23
+ end
9
24
 
10
25
  end
11
26
  end
@@ -1,3 +1,3 @@
1
1
  module BitstampClient
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitstamp_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ramon Tayag
@@ -137,7 +137,7 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: 0.4.0
139
139
  - !ruby/object:Gem::Dependency
140
- name: factory_girl
140
+ name: factory_bot
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ">="