Class: BaseValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/schemy/validators/base_validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table) ⇒ BaseValidator

Returns a new instance of BaseValidator.



5
6
7
# File 'lib/schemy/validators/base_validator.rb', line 5

def initialize(table)
  @table = table
end

Instance Attribute Details

#tableObject (readonly)

Returns the value of attribute table.



3
4
5
# File 'lib/schemy/validators/base_validator.rb', line 3

def table
  @table
end

Instance Method Details

#validateObject

returns array of unindexed columns which should be indexed



10
11
12
13
14
15
16
# File 'lib/schemy/validators/base_validator.rb', line 10

def validate
  @missing_indices = []
  @table.columns.each do |column|
    validate_column column.name.to_s
  end
  @missing_indices
end