Class: TheArrayComparator::TestingHelper::DataSet

Inherits:
Object
  • Object
show all
Defined in:
lib/the_array_comparator/testing_helper/data_set.rb

Overview

Keywords only make sense together with the raw data

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(keywords = [], raw_data = []) ⇒ DataSet

Create new instance



16
17
18
19
# File 'lib/the_array_comparator/testing_helper/data_set.rb', line 16

def initialize(keywords=[],raw_data=[])
  @keywords = keywords
  @raw_data = raw_data
end

Instance Attribute Details

#keywordsObject

keywords which need to be hidden in the raw data



10
11
12
# File 'lib/the_array_comparator/testing_helper/data_set.rb', line 10

def keywords
  @keywords
end

#raw_dataObject

the raw data which should be used to hide the keywords



10
# File 'lib/the_array_comparator/testing_helper/data_set.rb', line 10

attr_accessor :keywords, :raw_data

Instance Method Details

#count_of_keywordsInteger

The count of the keywords

Returns:

  • (Integer)

    How many key words are available



40
41
42
# File 'lib/the_array_comparator/testing_helper/data_set.rb', line 40

def count_of_keywords
  keywords.size
end

#stripe_of_dataArray

A stripe of data

Returns:

  • (Array)

    a pice of raw data



25
26
27
# File 'lib/the_array_comparator/testing_helper/data_set.rb', line 25

def stripe_of_data
  raw_data.shift(stripe_size)
end

#stripe_of_keywordsString, Integer

A tripe of the keywords

Returns:

  • (String, Integer)

    one keyword



33
34
35
# File 'lib/the_array_comparator/testing_helper/data_set.rb', line 33

def stripe_of_keywords
  keywords.shift unless keywords.blank?
end