Skip to content

Commit 7869512

Browse files
author
Hartmut Bischoff
committed
Push Version
1 parent ecc29da commit 7869512

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
972.1
1+
972.2

api.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
3535
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
3636
spec.require_paths = ["lib"]
3737

38-
spec.add_development_dependency "bundler", "~> 1.17"
38+
spec.add_development_dependency "bundler"
3939
spec.add_development_dependency "rake", "~> 13.0"
4040
spec.add_development_dependency "rspec", "~> 3.0"
4141
spec.add_dependency 'activesupport', '>= 6.0'

changelog.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ Changelog
1515
| 1.12.2020 | creating a dummy Contract#verify to guaranty safe operation of spreads |
1616

1717
| | Preparation of a Gem-Release |
18-
18+
| 23.2.2021 | Fixed retrieving of ContractDetail requests of Options with strikes < 1
19+
| | Gem Release |

lib/models/ib/spread.rb

+8-4
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,20 @@ def remove_leg contract
111111

112112

113113
def essential
114-
legs.each{ |x| x.essential }
115-
self
114+
invariant_attributes
116115
end
116+
117117
def multiplier
118118
(legs.map(&:multiplier).sum/legs.size).to_i
119119
end
120120

121-
# provide a negative con_id
121+
# provide a negative con_id
122122
def con_id
123-
-legs.map(&:con_id).sum
123+
if attributes[:con_id].present? && attributes[] < 0
124+
attributes[:con_id]
125+
else
126+
-legs.map{ |x| x.is_a?(String) ? x.expand.con_id : x.con_id}.sum
127+
end
124128
end
125129

126130

0 commit comments

Comments
 (0)