Class: Alpaca::Trade::Api::TradeActivity

Inherits:
Object
  • Object
show all
Defined in:
lib/alpaca/trade/api/trade_activity.rb

Constant Summary collapse

ATTRIBUTES =
%w(id activity_type transaction_time type price qty side
symbol leaves_qty order_id cum_qty)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ TradeActivity

Returns a new instance of TradeActivity.



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/alpaca/trade/api/trade_activity.rb', line 13

def initialize(json)
  @id = json['id']
  @activity_type = json['activity_type']
  @transaction_time = json['transaction_time']
  @type = json['type']
  @price = json['price']
  @qty = json['qty']
  @side = json['side']
  @symbol = json['symbol']
  @leaves_qty = json['leaves_qty']
  @order_id = json['order_id']
  @cum_qty = json['cum_qty']
end

Instance Attribute Details

#activity_typeObject (readonly)

Returns the value of attribute activity_type.



10
11
12
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10

def activity_type
  @activity_type
end

#cum_qtyObject (readonly)

Returns the value of attribute cum_qty.



10
11
12
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10

def cum_qty
  @cum_qty
end

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10

def id
  @id
end

#leaves_qtyObject (readonly)

Returns the value of attribute leaves_qty.



10
11
12
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10

def leaves_qty
  @leaves_qty
end

#order_idObject (readonly)

Returns the value of attribute order_id.



10
11
12
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10

def order_id
  @order_id
end

#priceObject (readonly)

Returns the value of attribute price.



10
11
12
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10

def price
  @price
end

#qtyObject (readonly)

Returns the value of attribute qty.



10
11
12
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10

def qty
  @qty
end

#sideObject (readonly)

Returns the value of attribute side.



10
11
12
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10

def side
  @side
end

#symbolObject (readonly)

Returns the value of attribute symbol.



10
11
12
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10

def symbol
  @symbol
end

#transaction_timeObject (readonly)

Returns the value of attribute transaction_time.



10
11
12
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10

def transaction_time
  @transaction_time
end

#typeObject (readonly)

Returns the value of attribute type.



10
11
12
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10

def type
  @type
end