Class: Attr::Gather::Filters::Contract
- Defined in:
- lib/attr/gather/filters/contract.rb
Overview
Filters values with a dry-validation contract
Defined Under Namespace
Classes: IncompatibleContractError
Instance Attribute Summary collapse
-
#dry_contract ⇒ Object
readonly
Returns the value of attribute dry_contract.
Instance Method Summary collapse
- #call(input) ⇒ Object
-
#initialize(dry_contract) ⇒ Contract
constructor
Creates a new instance of the filter.
Constructor Details
#initialize(dry_contract) ⇒ Contract
Creates a new instance of the filter
15 16 17 18 19 |
# File 'lib/attr/gather/filters/contract.rb', line 15 def initialize(dry_contract) validate_dry_contract!(dry_contract) @dry_contract = dry_contract super() end |
Instance Attribute Details
#dry_contract ⇒ Object (readonly)
Returns the value of attribute dry_contract.
10 11 12 |
# File 'lib/attr/gather/filters/contract.rb', line 10 def dry_contract @dry_contract end |