Class: BloodContracts::Core::Contract
- Inherits:
-
Object
- Object
- BloodContracts::Core::Contract
- Defined in:
- lib/blood_contracts/core/contract.rb
Class Attribute Summary collapse
-
.input_type ⇒ Object
Returns the value of attribute input_type.
-
.output_type ⇒ Object
Returns the value of attribute output_type.
Class Method Summary collapse
Class Attribute Details
.input_type ⇒ Object
Returns the value of attribute input_type.
5 6 7 |
# File 'lib/blood_contracts/core/contract.rb', line 5 def input_type @input_type end |
.output_type ⇒ Object
Returns the value of attribute output_type.
5 6 7 |
# File 'lib/blood_contracts/core/contract.rb', line 5 def output_type @output_type end |
Class Method Details
.call(*args) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/blood_contracts/core/contract.rb', line 8 def self.call(*args) if (input_match = input_type.match(*args)).valid? result = yield(input_match) output_type.match(result, context: input_match.context) else input_match end end |