Class: Definition::Types::Include::Conformer

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

Instance Method Summary collapse

Constructor Details

#initialize(definition) ⇒ Conformer

Returns a new instance of Conformer.



22
23
24
# File 'lib/definition/types/include.rb', line 22

def initialize(definition)
  self.definition = definition
end

Instance Method Details

#conform(value) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/definition/types/include.rb', line 26

def conform(value)
  errors = gather_errors(value)

  if errors.empty?
    ConformResult.new(value)
  else
    ConformResult.new(value, errors: errors)
  end
end