Class: IB::Stock
Constant Summary
Constants inherited from Contract
Instance Attribute Summary
Attributes inherited from Contract
Instance Method Summary collapse
Methods inherited from Contract
#==, #bag?, #bond?, build, #essential, #expiry, #index?, #merge, #option?, #order_requirements, #serialize, #serialize_ib_ruby, #serialize_legs, #serialize_long, #serialize_short, #serialize_supershort, #serialize_under_comp, #stock?, #table_header, #table_row, #to_s, #to_short, #verify
Methods included from BaseProperties
#==, #as_table, #content_attributes, #invariant_attributes, #set_attribute_defaults, #table_header, #table_row, #update_missing
Instance Method Details
#default_attributes ⇒ Object
8 9 10 |
# File 'lib/models/ib/stock.rb', line 8 def default_attributes super.merge :sec_type => :stock, currency:'USD', exchange:'SMART' end |
#to_human ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/models/ib/stock.rb', line 12 def to_human att = [ symbol, currency, ( exchange == 'SMART' ? nil: exchange ), (primary_exchange.present? && !primary_exchange.empty? ? primary_exchange : nil), @description.present? ? " (#{@description}) " : nil, ].compact "<Stock: " + att.join(" ") + ">" end |