class Stannum::Contracts::Parameters::SignatureContract
A SignatureContract
defines a parameters object for a ParametersContract
.
Public Class Methods
new(**options)
click to toggle source
@param options [Hash<Symbol, Object>] Configuration options for the
contract. Defaults to an empty Hash.
Calls superclass method
Stannum::Contracts::HashContract::new
# File lib/stannum/contracts/parameters/signature_contract.rb, line 10 def initialize(**options) super(key_type: Symbol, **options) end
Private Instance Methods
define_constraints(&block)
click to toggle source
Calls superclass method
Stannum::Contracts::MapContract#define_constraints
# File lib/stannum/contracts/parameters/signature_contract.rb, line 16 def define_constraints(&block) super add_key_constraint :arguments, Stannum::Constraints::Types::ArrayType.new add_key_constraint :keywords, Stannum::Constraints::Types::HashType.new( key_type: Stannum::Constraints::Types::SymbolType.new ) add_key_constraint :block, Stannum::Constraints::Types::ProcType.new(optional: true) end