Class: Tastytrade::Models::Fill

Inherits:
Base
  • Object
show all
Defined in:
lib/tastytrade/models/live_order.rb

Overview

Represents a fill execution

Instance Attribute Summary collapse

Attributes inherited from Base

#data

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Tastytrade::Models::Base

Instance Attribute Details

#destination_venueObject (readonly)

Returns the value of attribute destination_venue.



238
239
240
# File 'lib/tastytrade/models/live_order.rb', line 238

def destination_venue
  @destination_venue
end

#ext_exec_idObject (readonly)

Returns the value of attribute ext_exec_id.



238
239
240
# File 'lib/tastytrade/models/live_order.rb', line 238

def ext_exec_id
  @ext_exec_id
end

#ext_group_fill_idObject (readonly)

Returns the value of attribute ext_group_fill_id.



238
239
240
# File 'lib/tastytrade/models/live_order.rb', line 238

def ext_group_fill_id
  @ext_group_fill_id
end

#fill_idObject (readonly)

Returns the value of attribute fill_id.



238
239
240
# File 'lib/tastytrade/models/live_order.rb', line 238

def fill_id
  @fill_id
end

#fill_priceObject (readonly)

Returns the value of attribute fill_price.



238
239
240
# File 'lib/tastytrade/models/live_order.rb', line 238

def fill_price
  @fill_price
end

#filled_atObject (readonly)

Returns the value of attribute filled_at.



238
239
240
# File 'lib/tastytrade/models/live_order.rb', line 238

def filled_at
  @filled_at
end

#quantityObject (readonly)

Returns the value of attribute quantity.



238
239
240
# File 'lib/tastytrade/models/live_order.rb', line 238

def quantity
  @quantity
end

Instance Method Details

#to_hObject

Convert to hash for JSON serialization



242
243
244
245
246
247
248
249
250
251
252
# File 'lib/tastytrade/models/live_order.rb', line 242

def to_h
  {
    ext_exec_id: @ext_exec_id,
    ext_group_fill_id: @ext_group_fill_id,
    fill_id: @fill_id,
    quantity: @quantity,
    fill_price: @fill_price&.to_s("F"),
    filled_at: @filled_at&.iso8601,
    destination_venue: @destination_venue
  }.compact
end