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.



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

def initialize(definition)
  self.definition = definition
end

Instance Method Details

#conform(value) ⇒ Object



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

def conform(value)
  errors = gather_errors(value)

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