Class: CodeMetrics::Statistics
- Inherits:
-
Object
- Object
- CodeMetrics::Statistics
- Defined in:
- lib/code_metrics/statistics.rb
Constant Summary collapse
- TEST_TYPES =
[]
Instance Method Summary collapse
-
#initialize(*pairs) ⇒ Statistics
constructor
A new instance of Statistics.
- #to_s ⇒ Object
Constructor Details
#initialize(*pairs) ⇒ Statistics
Returns a new instance of Statistics.
9 10 11 12 13 |
# File 'lib/code_metrics/statistics.rb', line 9 def initialize(*pairs) @pairs = pairs @statistics = calculate_statistics @total = calculate_total if pairs.length > 1 end |
Instance Method Details
#to_s ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/code_metrics/statistics.rb', line 15 def to_s print_header @pairs.each { |pair| print_line(pair.first, @statistics[pair.first]) } print_splitter if @total print_line("Total", @total) print_splitter end print_code_test_stats end |