lib/ib-ruby/models/contract.rb in ib-ruby-0.4.22 vs lib/ib-ruby/models/contract.rb in ib-ruby-0.5.0
- old
+ new
@@ -96,11 +96,10 @@
:next_option_partial, # bool: # only if bond has embedded options.
:notes # Additional notes, if populated for the bond in IB's database
# Used for Delta-Neutral Combo contracts only!
# UnderComp fields are bundled into Contract proper, as it should be.
- # Already defined
attr_accessor :under_comp, # if not nil, attributes below are sent to server
#:under_con_id is is already defined in ContractDetails section
:under_delta, # double: The underlying stock or future delta.
:under_price # double: The price of the underlying.
@@ -140,9 +139,10 @@
end
def right=(x)
x.upcase! if x.is_a?(String)
x = nil if !x.nil? && x.empty?
+ x = nil if x == "0"
raise(ArgumentError.new("Invalid right \"#{x}\" (must be one of PUT, CALL, P, C)")) unless x.nil? || ["PUT", "CALL", "P", "C", "0"].include?(x)
@right = x
end
def expiry=(x)