Class: Alpaca::Trade::Api::Asset

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Asset

Returns a new instance of Asset.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/alpaca/trade/api/asset.rb', line 10

def initialize(json)
  @id = json['id']
  @asset_class = json['class']
  @exchange = json['exchange']
  @symbol = json['symbol']
  @status = json['status']
  @tradable = json['tradable']
  @marginable = json['marginable']
  @shortable = json['shortable']
  @easy_to_borrow = json['easy_to_borrow']
  @fractionable = json['fractionable']
end

Instance Attribute Details

#asset_classObject (readonly)

Returns the value of attribute asset_class.



7
8
9
# File 'lib/alpaca/trade/api/asset.rb', line 7

def asset_class
  @asset_class
end

#easy_to_borrowObject (readonly)

Returns the value of attribute easy_to_borrow.



7
8
9
# File 'lib/alpaca/trade/api/asset.rb', line 7

def easy_to_borrow
  @easy_to_borrow
end

#exchangeObject (readonly)

Returns the value of attribute exchange.



7
8
9
# File 'lib/alpaca/trade/api/asset.rb', line 7

def exchange
  @exchange
end

#fractionableObject (readonly)

Returns the value of attribute fractionable.



7
8
9
# File 'lib/alpaca/trade/api/asset.rb', line 7

def fractionable
  @fractionable
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/alpaca/trade/api/asset.rb', line 7

def id
  @id
end

#marginableObject (readonly)

Returns the value of attribute marginable.



7
8
9
# File 'lib/alpaca/trade/api/asset.rb', line 7

def marginable
  @marginable
end

#shortableObject (readonly)

Returns the value of attribute shortable.



7
8
9
# File 'lib/alpaca/trade/api/asset.rb', line 7

def shortable
  @shortable
end

#statusObject (readonly)

Returns the value of attribute status.



7
8
9
# File 'lib/alpaca/trade/api/asset.rb', line 7

def status
  @status
end

#symbolObject (readonly)

Returns the value of attribute symbol.



7
8
9
# File 'lib/alpaca/trade/api/asset.rb', line 7

def symbol
  @symbol
end

#tradableObject (readonly)

Returns the value of attribute tradable.



7
8
9
# File 'lib/alpaca/trade/api/asset.rb', line 7

def tradable
  @tradable
end