lib/csv2hash/structure_validator.rb in csv2hash-0.2.1 vs lib/csv2hash/structure_validator.rb in csv2hash-0.3.0
- old
+ new
@@ -1,5 +1,7 @@
+# require 'active_support/core_ext'
+
module Csv2hash::StructureValidator
class ValidationError < StandardError ; end
def validate_structure!
definition.structure_rules.each do |rule, options|
@@ -12,16 +14,17 @@
end
end
def rule_instance rule, options
Csv2hash::StructureValidator.const_get(rule).new(options)
+ # 'min_columns'.camelize.constantize.new
end
module Validator
def validate! source
source.index { |line| validate_line line }.tap do |line|
raise Csv2hash::StructureValidator::ValidationError, error_message(line) unless line.nil?
end
true
end
end
-end
\ No newline at end of file
+end