Use this for specifying contracts for keyword arguments Example:
KeywordArgs[ e: Range, f: Optional[Num] ]
# File lib/contracts/builtin_contracts.rb, line 418 def initialize(options) @options = options end
# File lib/contracts/builtin_contracts.rb, line 434 def inspect to_s end
# File lib/contracts/builtin_contracts.rb, line 430 def to_s "KeywordArgs[#{options}]" end
# File lib/contracts/builtin_contracts.rb, line 422 def valid?(hash) return false unless hash.is_a?(Hash) return false unless hash.keys - options.keys == [] options.all? do |key, contract| Optional._valid?(hash, key, contract) end end