Class: Alpaca::Trade::Api::TradeActivity
- Inherits:
-
Object
- Object
- Alpaca::Trade::Api::TradeActivity
- 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
-
#activity_type ⇒ Object
readonly
Returns the value of attribute activity_type.
-
#cum_qty ⇒ Object
readonly
Returns the value of attribute cum_qty.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#leaves_qty ⇒ Object
readonly
Returns the value of attribute leaves_qty.
-
#order_id ⇒ Object
readonly
Returns the value of attribute order_id.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#qty ⇒ Object
readonly
Returns the value of attribute qty.
-
#side ⇒ Object
readonly
Returns the value of attribute side.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
-
#transaction_time ⇒ Object
readonly
Returns the value of attribute transaction_time.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(json) ⇒ TradeActivity
constructor
A new instance of TradeActivity.
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_type ⇒ Object (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_qty ⇒ Object (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 |
#id ⇒ Object (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_qty ⇒ Object (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_id ⇒ Object (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 |
#price ⇒ Object (readonly)
Returns the value of attribute price.
10 11 12 |
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10 def price @price end |
#qty ⇒ Object (readonly)
Returns the value of attribute qty.
10 11 12 |
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10 def qty @qty end |
#side ⇒ Object (readonly)
Returns the value of attribute side.
10 11 12 |
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10 def side @side end |
#symbol ⇒ Object (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_time ⇒ Object (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 |
#type ⇒ Object (readonly)
Returns the value of attribute type.
10 11 12 |
# File 'lib/alpaca/trade/api/trade_activity.rb', line 10 def type @type end |