Module: Trailblazer::Operation::Procedural::Contract
- Defined in:
- lib/trailblazer/operation/procedural/contract.rb
Overview
THIS IS UNTESTED, PRIVATE API AND WILL BE REMOVED SOON.
Instance Method Summary collapse
-
#contract!(model: nil, options: {}, contract_class: nil) ⇒ Object
Override to construct your own contract.
-
#contract_for(model: self["model"], options: {}, contract_class: self["contract.default.class"]) ⇒ Object
Instantiate the contract, either by using the user’s contract passed into #validate or infer the Operation contract.
Instance Method Details
#contract!(model: nil, options: {}, contract_class: nil) ⇒ Object
Override to construct your own contract.
11 12 13 |
# File 'lib/trailblazer/operation/procedural/contract.rb', line 11 def contract!(model:nil, options:{}, contract_class:nil) contract_class.new(model, ) end |
#contract_for(model: self["model"], options: {}, contract_class: self["contract.default.class"]) ⇒ Object
Instantiate the contract, either by using the user’s contract passed into #validate or infer the Operation contract.
6 7 8 |
# File 'lib/trailblazer/operation/procedural/contract.rb', line 6 def contract_for(model:self["model"], options:{}, contract_class:self["contract.default.class"]) contract!(model: model, options: , contract_class: contract_class) end |