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 Object
Methods inherited from Type
anonymous?, base, 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
42 43 44 45 46 47 48 |
# File 'lib/axiom/types/hash.rb', line 42 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
28 29 30 31 32 33 34 35 |
# File 'lib/axiom/types/hash.rb', line 28 def self.infer(object) case object when primitive infer_from_primitive_instance(object) else super end end |