Class: Ree::Contracts::ContractDefinition
- Defined in:
- lib/ree/contracts/contract_definition.rb
Instance Attribute Summary collapse
-
#arg_contracts ⇒ Object
readonly
Returns the value of attribute arg_contracts.
-
#block_contract ⇒ Object
readonly
Returns the value of attribute block_contract.
-
#return_contract ⇒ Object
readonly
Returns the value of attribute return_contract.
Instance Method Summary collapse
-
#initialize(contract) ⇒ ContractDefinition
constructor
A new instance of ContractDefinition.
Constructor Details
#initialize(contract) ⇒ ContractDefinition
Returns a new instance of ContractDefinition.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/ree/contracts/contract_definition.rb', line 7 def initialize(contract) @arg_contracts, @return_contract = split_contract(contract) @block_contract = arg_contracts.pop if ArgContracts.opt_or_block?(arg_contracts.last) validate_block_contract validate_return_contract validate_kwargs_contract validate_splat_contract validate_ksplat_contract validate_dependent_contracts end |
Instance Attribute Details
#arg_contracts ⇒ Object (readonly)
Returns the value of attribute arg_contracts.
5 6 7 |
# File 'lib/ree/contracts/contract_definition.rb', line 5 def arg_contracts @arg_contracts end |
#block_contract ⇒ Object (readonly)
Returns the value of attribute block_contract.
5 6 7 |
# File 'lib/ree/contracts/contract_definition.rb', line 5 def block_contract @block_contract end |
#return_contract ⇒ Object (readonly)
Returns the value of attribute return_contract.
5 6 7 |
# File 'lib/ree/contracts/contract_definition.rb', line 5 def return_contract @return_contract end |