Class: Axiom::Types::Object
Overview
Represents an object type
Direct Known Subclasses
Boolean, Class, Collection, Date, DateTime, Hash, Numeric, String, Symbol, Time
Class Method Summary collapse
-
.finalize ⇒ Class<Axiom::Types::Object>
private
Finalize by setting up a primitive constraint.
-
.infer(object) ⇒ Class<Axiom::Types::Object>?
Infer the type of the object.
-
.inspect ⇒ String
The type name and primitive.
Methods inherited from Type
anonymous?, base, base?, constraint, include?, includes, new
Methods included from Options
Class Method Details
.finalize ⇒ Class<Axiom::Types::Object>
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 a primitive constraint
34 35 36 37 38 |
# File 'lib/axiom/types/object.rb', line 34 def self.finalize return self if frozen? inherits_from_primitive super end |
.infer(object) ⇒ Class<Axiom::Types::Object>?
Infer the type of the object
25 26 27 |
# File 'lib/axiom/types/object.rb', line 25 def self.infer(object) super || infer_from_primitive_class(object) end |
.inspect ⇒ String
The type name and primitive
45 46 47 |
# File 'lib/axiom/types/object.rb', line 45 def self.inspect "#{base} (#{primitive})" end |