Class: Stannum::Contracts::MapContract::Builder Private
- Inherits:
-
Stannum::Contract::Builder
- Object
- Base::Builder
- Stannum::Contract::Builder
- Stannum::Contracts::MapContract::Builder
- Defined in:
- lib/stannum/contracts/map_contract.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Builder class for defining item constraints for a Contract.
This class should not be invoked directly. Instead, pass a block to the constructor for HashContract.
Instance Method Summary collapse
-
#key(property, constraint = nil, **options, &block) ⇒ Object
private
Defines a key constraint on the contract.
Methods inherited from Stannum::Contract::Builder
Instance Method Details
#key(key, constraint, **options) ⇒ Object #key(**options) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Defines a key constraint on the contract.
90 91 92 93 94 95 96 97 98 |
# File 'lib/stannum/contracts/map_contract.rb', line 90 def key(property, constraint = nil, **, &block) self.constraint( constraint, property: property, property_type: :key, **, &block ) end |