Class: Axiom::Types::Hash
Overview
Represents a hash type
Class Method Summary collapse
-
.finalize ⇒ Class<Axiom::Types::Hash>
private
Finalize by setting up constraints for the key and value.
-
.infer(object) ⇒ Class<Axiom::Types::Hash>?
Infer the type of the object.
Methods inherited from Type
constraint, include?, includes, new
Methods included from Options
Class Method Details
.finalize ⇒ Class<Axiom::Types::Hash>
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.
Finalize by setting up constraints for the key and value
39 40 41 42 43 44 45 |
# File 'lib/axiom/types/hash.rb', line 39 def self.finalize return self if frozen? key_type.finalize value_type.finalize matches_key_and_value_types super end |
.infer(object) ⇒ Class<Axiom::Types::Hash>?
Infer the type of the object
25 26 27 28 29 30 31 32 |
# File 'lib/axiom/types/hash.rb', line 25 def self.infer(object) case object when primitive infer_from_primitive_instance(object) else super end end |