Module: Pragma::Operation::Validation::ClassMethods
- Defined in:
- lib/pragma/operation/validation.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#build_contract(resource) ⇒ Pragma::Contract::Base
Builds the contract for the given resource, using the previous defined contract class.
-
#contract(klass) ⇒ Object
Sets the contract to use for validating this operation.
-
#contract_klass ⇒ Class
Returns the contract class.
Instance Method Details
#build_contract(resource) ⇒ Pragma::Contract::Base
Builds the contract for the given resource, using the previous defined contract class.
35 36 37 |
# File 'lib/pragma/operation/validation.rb', line 35 def build_contract(resource) contract_klass.new(resource) end |
#contract(klass) ⇒ Object
Sets the contract to use for validating this operation.
17 18 19 |
# File 'lib/pragma/operation/validation.rb', line 17 def contract(klass) @contract = klass end |
#contract_klass ⇒ Class
Returns the contract class.
24 25 26 |
# File 'lib/pragma/operation/validation.rb', line 24 def contract_klass @contract end |