Class: QuickTicker::Stock

Inherits:
Table
  • Object
show all
Defined in:
lib/stock.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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.related_companies = []
	data[:related_companies].each do |related_company_hash|
		self.related_companies << QuickTicker::StockRelatedCompany.new(related_company_hash, self)
	end
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/stock.rb', line 5

def description
  @description
end

#quoteObject

Returns the value of attribute quote.



5
6
7
# File 'lib/stock.rb', line 5

def quote
  @quote
end

Returns the value of attribute related_companies.



5
6
7
# File 'lib/stock.rb', line 5

def related_companies
  @related_companies
end