Class: Remap::Contract
- Inherits:
- 
      Dry::Validation::Contract
      
        - Object
- Dry::Validation::Contract
- Remap::Contract
 
- Defined in:
- lib/remap/contract.rb
Class Method Summary collapse
- 
  
    
      .call(rules:, options:, contract:, attributes:)  ⇒ Contract 
    
    
  
  
  
  
  
  
  
  
  
    Constructs a contract used to validate mapper input. 
Class Method Details
.call(rules:, options:, contract:, attributes:) ⇒ Contract
Constructs a contract used to validate mapper input
| 13 14 15 16 17 18 19 20 21 22 23 24 25 | # File 'lib/remap/contract.rb', line 13 def self.call(rules:, options:, contract:, attributes:) Class.new(self) do rules.each do |rule| instance_exec(&rule) end options.each do |option| instance_exec(&option) end schema(contract) end.new(**attributes) end |