snaptrade 2.0.210 → 2.0.211
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 +2 -2
- data/lib/snaptrade/models/option_instrument.rb +16 -1
- data/lib/snaptrade/version.rb +1 -1
- data/spec/models/option_instrument_spec.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a61e87e25d9559648084c04fc57b2c0fa4f4b7c7eb316091f23172bf2a8ff392
|
|
4
|
+
data.tar.gz: 859c58b73eae3ef31fbff3e9a1b81cb6dc12f3ffffb08169d1f72e65a27b0332
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b5f4df0490eba163d86f194ed1e9bbf1aa575fb2dd3a3c2cfa7888b173d5e3435881da32ca80e87a0d95da2bc3f90a48bf9a86c54a4378b712dfa6f398a90fd3
|
|
7
|
+
data.tar.gz: 7f7a5221532b56d1f1fc228d75a2556153f7e76a9e3013982250da243d48cf5f94ef17db34cb47c959f9d3dba0c8dbd27bd2bdb1e3ff3ec6bcca53e936e31de7
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Connect brokerage accounts to your app for live positions and trading
|
|
8
8
|
|
|
9
|
-
[](https://rubygems.org/gems/snaptrade/versions/2.0.211)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -94,7 +94,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
94
94
|
Add to Gemfile:
|
|
95
95
|
|
|
96
96
|
```ruby
|
|
97
|
-
gem 'snaptrade', '~> 2.0.
|
|
97
|
+
gem 'snaptrade', '~> 2.0.211'
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -31,6 +31,9 @@ module SnapTrade
|
|
|
31
31
|
# Expiration date of the option contract.
|
|
32
32
|
attr_accessor :expiration_date
|
|
33
33
|
|
|
34
|
+
# Number of underlying shares per contract. Standard options are 100, mini options are 10.
|
|
35
|
+
attr_accessor :multiplier
|
|
36
|
+
|
|
34
37
|
# Human-readable description of the option contract.
|
|
35
38
|
attr_accessor :description
|
|
36
39
|
|
|
@@ -45,6 +48,7 @@ module SnapTrade
|
|
|
45
48
|
:'option_type' => :'option_type',
|
|
46
49
|
:'strike_price' => :'strike_price',
|
|
47
50
|
:'expiration_date' => :'expiration_date',
|
|
51
|
+
:'multiplier' => :'multiplier',
|
|
48
52
|
:'description' => :'description',
|
|
49
53
|
:'underlying' => :'underlying'
|
|
50
54
|
}
|
|
@@ -64,6 +68,7 @@ module SnapTrade
|
|
|
64
68
|
:'option_type' => :'OptionType',
|
|
65
69
|
:'strike_price' => :'Float',
|
|
66
70
|
:'expiration_date' => :'Date',
|
|
71
|
+
:'multiplier' => :'Float',
|
|
67
72
|
:'description' => :'String',
|
|
68
73
|
:'underlying' => :'UnderlyingOptionInstrument'
|
|
69
74
|
}
|
|
@@ -115,6 +120,10 @@ module SnapTrade
|
|
|
115
120
|
self.expiration_date = attributes[:'expiration_date']
|
|
116
121
|
end
|
|
117
122
|
|
|
123
|
+
if attributes.key?(:'multiplier')
|
|
124
|
+
self.multiplier = attributes[:'multiplier']
|
|
125
|
+
end
|
|
126
|
+
|
|
118
127
|
if attributes.key?(:'description')
|
|
119
128
|
self.description = attributes[:'description']
|
|
120
129
|
end
|
|
@@ -152,6 +161,10 @@ module SnapTrade
|
|
|
152
161
|
invalid_properties.push('invalid value for "expiration_date", expiration_date cannot be nil.')
|
|
153
162
|
end
|
|
154
163
|
|
|
164
|
+
if @multiplier.nil?
|
|
165
|
+
invalid_properties.push('invalid value for "multiplier", multiplier cannot be nil.')
|
|
166
|
+
end
|
|
167
|
+
|
|
155
168
|
if @underlying.nil?
|
|
156
169
|
invalid_properties.push('invalid value for "underlying", underlying cannot be nil.')
|
|
157
170
|
end
|
|
@@ -168,6 +181,7 @@ module SnapTrade
|
|
|
168
181
|
return false if @option_type.nil?
|
|
169
182
|
return false if @strike_price.nil?
|
|
170
183
|
return false if @expiration_date.nil?
|
|
184
|
+
return false if @multiplier.nil?
|
|
171
185
|
return false if @underlying.nil?
|
|
172
186
|
true
|
|
173
187
|
end
|
|
@@ -183,6 +197,7 @@ module SnapTrade
|
|
|
183
197
|
option_type == o.option_type &&
|
|
184
198
|
strike_price == o.strike_price &&
|
|
185
199
|
expiration_date == o.expiration_date &&
|
|
200
|
+
multiplier == o.multiplier &&
|
|
186
201
|
description == o.description &&
|
|
187
202
|
underlying == o.underlying
|
|
188
203
|
end
|
|
@@ -196,7 +211,7 @@ module SnapTrade
|
|
|
196
211
|
# Calculates hash code according to all attributes.
|
|
197
212
|
# @return [Integer] Hash code
|
|
198
213
|
def hash
|
|
199
|
-
[kind, id, symbol, option_type, strike_price, expiration_date, description, underlying].hash
|
|
214
|
+
[kind, id, symbol, option_type, strike_price, expiration_date, multiplier, description, underlying].hash
|
|
200
215
|
end
|
|
201
216
|
|
|
202
217
|
# Builds the object from hash
|
data/lib/snaptrade/version.rb
CHANGED
|
@@ -56,6 +56,12 @@ describe SnapTrade::OptionInstrument do
|
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
+
describe 'test attribute "multiplier"' do
|
|
60
|
+
it 'should work' do
|
|
61
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
59
65
|
describe 'test attribute "description"' do
|
|
60
66
|
it 'should work' do
|
|
61
67
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|