Class: TheArrayComparator::TestingHelper::DataSet
- Inherits:
-
Object
- Object
- TheArrayComparator::TestingHelper::DataSet
- 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
-
#keywords ⇒ Object
keywords which need to be hidden in the raw data.
-
#raw_data ⇒ Object
the raw data which should be used to hide the keywords.
Instance Method Summary collapse
-
#count_of_keywords ⇒ Integer
The count of the keywords.
-
#initialize(keywords = [], raw_data = []) ⇒ DataSet
constructor
Create new instance.
-
#stripe_of_data ⇒ Array
A stripe of data.
-
#stripe_of_keywords ⇒ String, Integer
A tripe of the keywords.
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
#keywords ⇒ Object
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_data ⇒ Object
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_keywords ⇒ Integer
The count of the keywords
40 41 42 |
# File 'lib/the_array_comparator/testing_helper/data_set.rb', line 40 def count_of_keywords keywords.size end |
#stripe_of_data ⇒ Array
A stripe of 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_keywords ⇒ String, Integer
A tripe of the keywords
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 |