Sha256: e77f60f09aa844170373bd78e8317f56b4d023e1e7ce971d6092dcd931672b6a

Contents?: true

Size: 1018 Bytes

Versions: 3

Compression:

Stored size: 1018 Bytes

Contents

require 'fitting/report/actions'

module Fitting
  module Report
    class Prefix
      def initialize(name, tomogram_json_path, skip = false)
        @name = name
        @tomogram_json_path = tomogram_json_path
        @tests = Fitting::Report::Tests.new([])
        @skip = skip
        unless skip
          @actions = Fitting::Report::Actions.new(name, tomogram_json_path)
        end
      end

      def name
        @name
      end

      def tests
        @tests
      end

      def skip?
        @skip
      end

      def actions
        @actions
      end

      def details
        if @skip
          {
              name: @name,
              tests_size: @tests.size,
              actions: {tests_without_actions: [], actions_details: []}
          }
        else
          {
              name: @name,
              tests_size: @tests.size,
              actions: @actions.details(self)
          }
        end
      end

      def add_test(test)
        @tests.push(test)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fitting-2.15.0 lib/fitting/report/prefix.rb
fitting-2.14.1 lib/fitting/report/prefix.rb
fitting-2.14.0 lib/fitting/report/prefix.rb