class Stannum::Constraints::Types::HashWithStringKeys
Asserts that the object is a Hash with String keys.
Public Class Methods
new(value_type: nil, **options)
click to toggle source
@param value_type [Stannum::Constraints::Base, Class, nil] If set, then
the constraint will check the types of each value in the Hash against the expected type and will fail if any values do not match.
@param options [Hash<Symbol, Object>] Configuration options for the
constraint. Defaults to an empty Hash.
Calls superclass method
Stannum::Constraints::Types::HashType::new
# File lib/stannum/constraints/types/hash_with_string_keys.rb, line 13 def initialize(value_type: nil, **options) super( key_type: Stannum::Constraints::Types::StringType.new, value_type: coerce_value_type(value_type), **options ) end