Sha256: 3c63306d0381deda1fd643d30e442e5f96abb5aad6253b5e9cbe4fe2d10f7b49

Contents?: true

Size: 1.3 KB

Versions: 23

Compression:

Stored size: 1.3 KB

Contents

require 'fitting/statistics/list'

module Fitting
  class Statistics
    class Lists
      def initialize(measurement, depth)
        @measurement = measurement
        @depth = depth
      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, @depth).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, @depth).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, @depth).to_s
          ].join("\n")
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
fitting-2.18.3 lib/fitting/statistics/lists.rb
fitting-2.18.2 lib/fitting/statistics/lists.rb
fitting-2.18.1 lib/fitting/statistics/lists.rb
fitting-2.18.0 lib/fitting/statistics/lists.rb
fitting-2.17.0 lib/fitting/statistics/lists.rb
fitting-2.16.1 lib/fitting/statistics/lists.rb
fitting-2.16.0 lib/fitting/statistics/lists.rb
fitting-2.15.0 lib/fitting/statistics/lists.rb
fitting-2.14.1 lib/fitting/statistics/lists.rb
fitting-2.14.0 lib/fitting/statistics/lists.rb
fitting-2.13.1 lib/fitting/statistics/lists.rb
fitting-2.13.0 lib/fitting/statistics/lists.rb
fitting-2.12.1 lib/fitting/statistics/lists.rb
fitting-2.12.0 lib/fitting/statistics/lists.rb
fitting-2.11.0 lib/fitting/statistics/lists.rb
fitting-2.10.0 lib/fitting/statistics/lists.rb
fitting-2.9.1 lib/fitting/statistics/lists.rb
fitting-2.9.0 lib/fitting/statistics/lists.rb
fitting-2.8.1 lib/fitting/statistics/lists.rb
fitting-2.8.0 lib/fitting/statistics/lists.rb