Sha256: d574006ce36bfce6c680ffb3e81197218b45b253cabae294d7a6f735497ecd09

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

Contents

#encoding: utf-8

# the main module
module TheArrayComparator
  # class holding the data for the comparism
  class Sample
    # @!attribute [rw] keywords
    #   data used to search in other data set
    #
    # @!attribute [rw] data
    #   test data
    #
    # @!attribute [rw] exceptions
    #   exceptions from data search
    #
    # @!attribute [rw] tag
    #   description of the probe
    attr_accessor :data, :keywords, :exceptions, :tag

    # New sample
    #
    # @param [Array] data ([])
    #  the data to look for keywords
    #
    # @param [Set] keywords (Set.new)
    #   the keywords (singular values/arrays will be transformed to a set)
    #
    # @param [Set] exceptions (Set.new)
    #   the exceptions  (singular values/arrays will be transformed to a set)
    #
    # @param [String] tag (nil)
    #   a tag to identify a sample
    def initialize(data=[],keywords=Set.new,exceptions=Set.new,tag=nil)
      @keywords = Set.new( [ *keywords ] )
      @data = *data
      @exceptions = Set.new( [ *exceptions ] )
      @tag = tag
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
the_array_comparator-0.4.0 lib/the_array_comparator/sample.rb
the_array_comparator-0.3.4 lib/the_array_comparator/sample.rb
the_array_comparator-0.3.1 lib/the_array_comparator/sample.rb
the_array_comparator-0.3.0 lib/the_array_comparator/sample.rb
the_array_comparator-0.2.0 lib/the_array_comparator/sample.rb