Class: QuickTicker::Stock
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#quote ⇒ Object
Returns the value of attribute quote.
-
#related_companies ⇒ Object
Returns the value of attribute related_companies.
Instance Method Summary collapse
-
#initialize(data) ⇒ Stock
constructor
A new instance of Stock.
Methods inherited from Table
create_table_columns, #populate_table_columns
Constructor Details
#initialize(data) ⇒ Stock
Returns a new instance of Stock.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/stock.rb', line 7 def initialize(data) super(data[:stock]) self.quote = QuickTicker::StockQuote.new(data[:quote], self) self.description = QuickTicker::StockDescription.new(data[:description], self) self. = [] data[:related_companies].each do || self. << QuickTicker::StockRelatedCompany.new(, self) end end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/stock.rb', line 5 def description @description end |
#quote ⇒ Object
Returns the value of attribute quote.
5 6 7 |
# File 'lib/stock.rb', line 5 def quote @quote end |
#related_companies ⇒ Object
Returns the value of attribute related_companies.
5 6 7 |
# File 'lib/stock.rb', line 5 def @related_companies end |