Class: Ytterb::StockSymbol::Freshness
- Inherits:
-
ReportBase
show all
- Defined in:
- lib/ytterb/stock_symbol/report_filters/freshness.rb
Instance Method Summary
collapse
Methods inherited from ReportBase
#initialize
Instance Method Details
#output ⇒ Object
20
21
22
23
24
25
|
# File 'lib/ytterb/stock_symbol/report_filters/freshness.rb', line 20
def output
output = "Freshness report\n" <<
"----------------\n"
@freshness.keys.sort.reverse.each {|k| output += "'#{k}' => #{@freshness[k].size} \n" }
output
end
|
#process ⇒ Object
11
12
13
14
15
16
17
18
|
# File 'lib/ytterb/stock_symbol/report_filters/freshness.rb', line 11
def process
@freshness = {}
@sml.stock_symbols.each do |smbl|
latest = smbl.history.keys.collect {|x| Date.parse(x)}.sort.last.to_s
@freshness[latest] ||= []
@freshness[latest] << smbl
end
end
|