Class: Definition::Types::Keys::Conformer

Inherits:
Object
  • Object
show all
Defined in:
lib/definition/types/keys.rb

Instance Method Summary collapse

Constructor Details

#initialize(definition, value) ⇒ Conformer

Returns a new instance of Conformer.



39
40
41
42
43
# File 'lib/definition/types/keys.rb', line 39

def initialize(definition, value)
  self.definition = definition
  self.value = value
  self.errors = []
end

Instance Method Details

#conformObject



45
46
47
48
49
50
51
# File 'lib/definition/types/keys.rb', line 45

def conform
  add_extra_key_errors
  add_missing_key_errors
  values = conform_all_keys

  ConformResult.new(values, errors: errors)
end