21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/finmodeling/net_income_calculation.rb', line 21
def summary(args)
summary_cache_key = args[:period].to_pretty_s
thesummary = lookup_cached_summary(summary_cache_key)
return thesummary if !thesummary.nil?
mapping = Xbrlware::ValueMapping.new
mapping.policy[:debit] = :flip
thesummary = super(:period => args[:period], :mapping => mapping)
if !lookup_cached_classifications(BASE_FILENAME, thesummary.rows)
lookahead = [4, thesummary.rows.length-1].min
classify_rows(ALL_STATES, NEXT_STATES, thesummary.rows, FinModeling::IncomeStatementItem, lookahead)
save_cached_classifications(BASE_FILENAME, thesummary.rows)
end
save_cached_summary(summary_cache_key, thesummary)
return thesummary
end
|