Module: Trailblazer::Operation::Representer::Deserializer::Hash

Defined in:
lib/trailblazer/operation/representer.rb

Instance Method Summary collapse

Instance Method Details

#validate_contract(params) ⇒ Object



56
57
58
59
60
61
# File 'lib/trailblazer/operation/representer.rb', line 56

def validate_contract(params)
  # use the inferred representer from the contract for deserialization in #validate.
  contract.validate(params) do |document|
    self.class.representer_class.new(contract).from_hash(document)
  end
end