snaptrade 2.0.134 → 2.0.135
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 +2 -2
- data/README.md +2 -2
- data/lib/snaptrade/models/position.rb +15 -4
- data/lib/snaptrade/version.rb +1 -1
- data/spec/models/position_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 106c4578f6b6cca16f45eeebe31a0bff1e196911864856d381c944863f274214
|
4
|
+
data.tar.gz: 871ecb294433452e872f948cfaa85cc506c408596f1e8dc579a01fba52e517b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0378122fe0c71ba2b185b7819509feba6cadf8cd7deca9cc0a674f5a1d40f7a24399f6dfe2b0cece7ca38ce27685d8fd788b1ae66e66ac3943c98b5e97e56f9c'
|
7
|
+
data.tar.gz: b293286be1e69f672a205b5d5578140faaa2d288aa1142043fd315b74cee0aac67e2b1885bcbc8cd8826dc9c939a75c9f63a2332d77a71a9f1dcd3d92c1ec13d
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
snaptrade (2.0.
|
4
|
+
snaptrade (2.0.135)
|
5
5
|
faraday (>= 1.0.1, < 3.0)
|
6
6
|
faraday-multipart (~> 1.0, >= 1.0.4)
|
7
7
|
|
@@ -58,7 +58,7 @@ GEM
|
|
58
58
|
rspec-mocks (3.13.5)
|
59
59
|
diff-lcs (>= 1.2.0, < 2.0)
|
60
60
|
rspec-support (~> 3.13.0)
|
61
|
-
rspec-support (3.13.
|
61
|
+
rspec-support (3.13.6)
|
62
62
|
rubocop (1.12.1)
|
63
63
|
parallel (~> 1.10)
|
64
64
|
parser (>= 3.0.0.0)
|
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.135)
|
10
10
|
[](https://snaptrade.com/)
|
11
11
|
|
12
12
|
</div>
|
@@ -81,7 +81,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
81
81
|
Add to Gemfile:
|
82
82
|
|
83
83
|
```ruby
|
84
|
-
gem 'snaptrade', '~> 2.0.
|
84
|
+
gem 'snaptrade', '~> 2.0.135'
|
85
85
|
```
|
86
86
|
|
87
87
|
## Getting Started<a id="getting-started"></a>
|
@@ -32,6 +32,9 @@ module SnapTrade
|
|
32
32
|
|
33
33
|
attr_accessor :currency
|
34
34
|
|
35
|
+
# If the position is a cash equivalent (usually a money market fund) that is also counted in account cash balance and buying power
|
36
|
+
attr_accessor :cash_equivalent
|
37
|
+
|
35
38
|
# Attribute mapping from ruby-style variable name to JSON key.
|
36
39
|
def self.attribute_map
|
37
40
|
{
|
@@ -41,7 +44,8 @@ module SnapTrade
|
|
41
44
|
:'open_pnl' => :'open_pnl',
|
42
45
|
:'average_purchase_price' => :'average_purchase_price',
|
43
46
|
:'fractional_units' => :'fractional_units',
|
44
|
-
:'currency' => :'currency'
|
47
|
+
:'currency' => :'currency',
|
48
|
+
:'cash_equivalent' => :'cash_equivalent'
|
45
49
|
}
|
46
50
|
end
|
47
51
|
|
@@ -59,7 +63,8 @@ module SnapTrade
|
|
59
63
|
:'open_pnl' => :'Float',
|
60
64
|
:'average_purchase_price' => :'Float',
|
61
65
|
:'fractional_units' => :'Float',
|
62
|
-
:'currency' => :'PositionCurrency'
|
66
|
+
:'currency' => :'PositionCurrency',
|
67
|
+
:'cash_equivalent' => :'Boolean'
|
63
68
|
}
|
64
69
|
end
|
65
70
|
|
@@ -71,6 +76,7 @@ module SnapTrade
|
|
71
76
|
:'open_pnl',
|
72
77
|
:'average_purchase_price',
|
73
78
|
:'fractional_units',
|
79
|
+
:'cash_equivalent'
|
74
80
|
])
|
75
81
|
end
|
76
82
|
|
@@ -116,6 +122,10 @@ module SnapTrade
|
|
116
122
|
if attributes.key?(:'currency')
|
117
123
|
self.currency = attributes[:'currency']
|
118
124
|
end
|
125
|
+
|
126
|
+
if attributes.key?(:'cash_equivalent')
|
127
|
+
self.cash_equivalent = attributes[:'cash_equivalent']
|
128
|
+
end
|
119
129
|
end
|
120
130
|
|
121
131
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -142,7 +152,8 @@ module SnapTrade
|
|
142
152
|
open_pnl == o.open_pnl &&
|
143
153
|
average_purchase_price == o.average_purchase_price &&
|
144
154
|
fractional_units == o.fractional_units &&
|
145
|
-
currency == o.currency
|
155
|
+
currency == o.currency &&
|
156
|
+
cash_equivalent == o.cash_equivalent
|
146
157
|
end
|
147
158
|
|
148
159
|
# @see the `==` method
|
@@ -154,7 +165,7 @@ module SnapTrade
|
|
154
165
|
# Calculates hash code according to all attributes.
|
155
166
|
# @return [Integer] Hash code
|
156
167
|
def hash
|
157
|
-
[symbol, units, price, open_pnl, average_purchase_price, fractional_units, currency].hash
|
168
|
+
[symbol, units, price, open_pnl, average_purchase_price, fractional_units, currency, cash_equivalent].hash
|
158
169
|
end
|
159
170
|
|
160
171
|
# Builds the object from hash
|
data/lib/snaptrade/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snaptrade
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.135
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SnapTrade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-09-
|
11
|
+
date: 2025-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|