Class: SchwabRb::DataObjects::ExecutionLeg
- Inherits:
-
Object
- Object
- SchwabRb::DataObjects::ExecutionLeg
- Defined in:
- lib/schwab_rb/data_objects/order.rb
Instance Attribute Summary collapse
-
#instrument_id ⇒ Object
readonly
Returns the value of attribute instrument_id.
-
#leg_id ⇒ Object
readonly
Returns the value of attribute leg_id.
-
#mismarked_quantity ⇒ Object
readonly
Returns the value of attribute mismarked_quantity.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(leg_id:, quantity:, mismarked_quantity:, price:, time:, instrument_id:) ⇒ ExecutionLeg
constructor
A new instance of ExecutionLeg.
- #to_h ⇒ Object
Constructor Details
#initialize(leg_id:, quantity:, mismarked_quantity:, price:, time:, instrument_id:) ⇒ ExecutionLeg
Returns a new instance of ExecutionLeg.
23 24 25 26 27 28 29 30 |
# File 'lib/schwab_rb/data_objects/order.rb', line 23 def initialize(leg_id:, quantity:, mismarked_quantity:, price:, time:, instrument_id:) @leg_id = leg_id @quantity = quantity @mismarked_quantity = mismarked_quantity @price = price @time = time @instrument_id = instrument_id end |
Instance Attribute Details
#instrument_id ⇒ Object (readonly)
Returns the value of attribute instrument_id.
8 9 10 |
# File 'lib/schwab_rb/data_objects/order.rb', line 8 def instrument_id @instrument_id end |
#leg_id ⇒ Object (readonly)
Returns the value of attribute leg_id.
8 9 10 |
# File 'lib/schwab_rb/data_objects/order.rb', line 8 def leg_id @leg_id end |
#mismarked_quantity ⇒ Object (readonly)
Returns the value of attribute mismarked_quantity.
8 9 10 |
# File 'lib/schwab_rb/data_objects/order.rb', line 8 def mismarked_quantity @mismarked_quantity end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
8 9 10 |
# File 'lib/schwab_rb/data_objects/order.rb', line 8 def price @price end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
8 9 10 |
# File 'lib/schwab_rb/data_objects/order.rb', line 8 def quantity @quantity end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
8 9 10 |
# File 'lib/schwab_rb/data_objects/order.rb', line 8 def time @time end |
Class Method Details
.build(data) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/schwab_rb/data_objects/order.rb', line 11 def build(data) new( leg_id: data[:legId], quantity: data[:quantity], mismarked_quantity: data[:mismarkedQuantity], price: data[:price], time: data[:time], instrument_id: data[:instrumentId] ) end |
Instance Method Details
#to_h ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/schwab_rb/data_objects/order.rb', line 32 def to_h { legId: @leg_id, quantity: @quantity, mismarkedQuantity: @mismarked_quantity, price: @price, time: @time, instrumentId: @instrument_id } end |