Class: RailsStats::StatsFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_stats/stats_formatter.rb

Direct Known Subclasses

ConsoleFormatter, JSONFormatter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(calculator, opts = {}) ⇒ StatsFormatter

Returns a new instance of StatsFormatter.



3
4
5
6
7
8
9
# File 'lib/rails_stats/stats_formatter.rb', line 3

def initialize(calculator, opts = {})
  @calculator  = calculator
  @statistics  = calculator.statistics
  @code_total  = calculator.code_total
  @tests_total = calculator.tests_total
  @grand_total = calculator.grand_total
end

Instance Attribute Details

#calculatorObject (readonly)

Returns the value of attribute calculator.



11
12
13
# File 'lib/rails_stats/stats_formatter.rb', line 11

def calculator
  @calculator
end