Class: Acorn::DataValidator
- Inherits:
-
Object
- Object
- Acorn::DataValidator
- Defined in:
- lib/acorn/data_validator.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ DataValidator
constructor
A new instance of DataValidator.
- #validate! ⇒ Object
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
#data ⇒ Object
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 |