Class: StockMarkit::Stock
- Inherits:
-
Object
- Object
- StockMarkit::Stock
- Defined in:
- lib/stock-markit/stock.rb
Overview
Stock Object
- Copyright
-
Copyright © 2016 Michael Heijmans
- License
-
MIT
Instance Attribute Summary collapse
-
#exchange ⇒ String
readonly
The exchange the stock is traded on.
-
#name ⇒ String
readonly
The company name.
-
#symbol ⇒ String
readonly
The Stock Symbol.
Instance Method Summary collapse
-
#initialize(symbol, name, exchange = nil) ⇒ Stock
constructor
A new instance of Stock.
Constructor Details
#initialize(symbol, name, exchange = nil) ⇒ Stock
Returns a new instance of Stock.
19 20 21 22 23 |
# File 'lib/stock-markit/stock.rb', line 19 def initialize(symbol, name, exchange=nil) @symbol = symbol @name = name @exchange = exchange end |
Instance Attribute Details
#exchange ⇒ String (readonly)
The exchange the stock is traded on
13 14 15 |
# File 'lib/stock-markit/stock.rb', line 13 def exchange @exchange end |
#name ⇒ String (readonly)
The company name
13 14 15 |
# File 'lib/stock-markit/stock.rb', line 13 def name @name end |
#symbol ⇒ String (readonly)
The Stock Symbol
13 14 15 |
# File 'lib/stock-markit/stock.rb', line 13 def symbol @symbol end |