Sha256: 023e7fbd34c99794fcd77335ca23d5f9c758cf5509dc8d89c6e506339a03f9df

Contents?: true

Size: 1.25 KB

Versions: 5

Compression:

Stored size: 1.25 KB

Contents

require 'fitting/statistics/list'

module Fitting
  class Statistics
    class Lists
      def initialize(measurement)
        @measurement = measurement
      end

      def to_s
        [
          coverage_fully_stat,
          coverage_partially_stat,
          coverage_non_stat
        ].compact.join("\n\n")
      end

      def coverage_fully_stat
        if @measurement.coverage_fully == []
          nil
        else
          [
            'Fully conforming requests:',
            Fitting::Statistics::List.new(@measurement.coverage_fully, @measurement.max_response_path).to_s
          ].join("\n")
        end
      end

      def coverage_partially_stat
        if @measurement.coverage_partially == []
          nil
        else
          [
            'Partially conforming requests:',
            Fitting::Statistics::List.new(@measurement.coverage_partially, @measurement.max_response_path).to_s
          ].join("\n")
        end
      end

      def coverage_non_stat
        if @measurement.coverage_non == []
          nil
        else
          [
            'Non-conforming requests:',
            Fitting::Statistics::List.new(@measurement.coverage_non, @measurement.max_response_path).to_s
          ].join("\n")
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fitting-2.6.0 lib/fitting/statistics/lists.rb
fitting-2.5.0 lib/fitting/statistics/lists.rb
fitting-2.4.1 lib/fitting/statistics/lists.rb
fitting-2.4.0 lib/fitting/statistics/lists.rb
fitting-2.3.0 lib/fitting/statistics/lists.rb