Module: Plumbing::Pipeline::Contracts
- Defined in:
- lib/plumbing/pipeline/contracts.rb
Overview
Validate input and output data with pre and post conditions or [Dry::Validation::Contract]s
Defined Under Namespace
Classes: ConditionValidator
Instance Method Summary
collapse
Instance Method Details
#post_condition(name) {|Object| ... } ⇒ Object
22
23
24
|
# File 'lib/plumbing/pipeline/contracts.rb', line 22
def post_condition name, &validator
post_conditions << ConditionValidator.new(name.to_s, validator)
end
|
#pre_condition(name) {|Object| ... } ⇒ Object
9
10
11
|
# File 'lib/plumbing/pipeline/contracts.rb', line 9
def pre_condition name, &validator
pre_conditions << ConditionValidator.new(name.to_s, validator)
end
|
#validate_with(contract_class) ⇒ Object
14
15
16
|
# File 'lib/plumbing/pipeline/contracts.rb', line 14
def validate_with contract_class
@validation_contract = contract_class
end
|