Class: Indexter::Validator

Inherits:
Object
  • Object
show all
Defined in:
lib/indexter/validator.rb

Constant Summary collapse

DEFAULT_FORMATTER =
'hash'
DEFAULT_EXCLUSIONS =
{ 'schema_migrations' => [] }.freeze
DEFAULT_SUFFIXES =
['_id', '_uuid'].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil) ⇒ Validator

——————– Instance Methods ——————–



13
14
15
# File 'lib/indexter/validator.rb', line 13

def initialize(config: nil)
  configure(config)
end

Instance Attribute Details

#exclusionsObject (readonly)

Returns the value of attribute exclusions.



5
6
7
# File 'lib/indexter/validator.rb', line 5

def exclusions
  @exclusions
end

#formatterObject (readonly)

Returns the value of attribute formatter.



5
6
7
# File 'lib/indexter/validator.rb', line 5

def formatter
  @formatter
end

#resultsObject (readonly)

Returns the value of attribute results.



5
6
7
# File 'lib/indexter/validator.rb', line 5

def results
  @results
end

#suffixesObject (readonly)

Returns the value of attribute suffixes.



5
6
7
# File 'lib/indexter/validator.rb', line 5

def suffixes
  @suffixes
end

Instance Method Details

#validateObject



17
18
19
20
21
22
# File 'lib/indexter/validator.rb', line 17

def validate
  missing = missing_indexes(tables)
  output  = build_results(missing)

  results = formatter.new.format(output)
end