Class: RailsStats::JSONFormatter
Instance Attribute Summary
#calculator
Instance Method Summary
collapse
#initialize
Instance Method Details
#result ⇒ Object
5
6
7
8
9
10
11
12
13
|
# File 'lib/rails_stats/json_formatter.rb', line 5
def result
@result = @statistics.map { |key, stats| stat_hash(key, stats) }
if @grand_total
@result << stat_hash("Total", @grand_total).merge(code_test_hash)
end
@result
end
|
#to_s ⇒ Object
15
16
17
|
# File 'lib/rails_stats/json_formatter.rb', line 15
def to_s
puts result.to_json
end
|