Class: Definition::Types::Lambda::Conformer
- Inherits:
-
Object
- Object
- Definition::Types::Lambda::Conformer
- Includes:
- Dsl
- Defined in:
- lib/definition/types/lambda.rb
Defined Under Namespace
Modules: Dsl
Instance Method Summary collapse
- #conform(value) ⇒ Object
-
#initialize(definition) ⇒ Conformer
constructor
A new instance of Conformer.
Methods included from Dsl
Constructor Details
#initialize(definition) ⇒ Conformer
Returns a new instance of Conformer.
36 37 38 |
# File 'lib/definition/types/lambda.rb', line 36 def initialize(definition) @definition = definition end |
Instance Method Details
#conform(value) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/definition/types/lambda.rb', line 40 def conform(value) lambda_result = instance_exec(value, &@definition.conformity_test_lambda) return lambda_result if lambda_result.is_a?(ConformResult) failure_result_with(value) end |