Class: Acorn::DataValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/acorn/data_validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ DataValidator

Returns a new instance of DataValidator.



4
5
6
# File 'lib/acorn/data_validator.rb', line 4

def initialize data
  self.data = data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



3
4
5
# File 'lib/acorn/data_validator.rb', line 3

def data
  @data
end

Instance Method Details

#validate!Object



7
8
9
10
11
# File 'lib/acorn/data_validator.rb', line 7

def validate! 
  if data.seed_names.length != data.attr_names.length
    raise 'There must be an equal number of seed names and column names defined.'
  end
end