Class: Mixture::Types::Object
Overview
An object. This adds the basic constraints all types (that inherit from Object) have; i.e., it must be an object, and it must be the type's primitive.
Direct Known Subclasses
Boolean, Class, Date, DateTime, Enumerable, Hash, Nil, Numeric, String, Symbol, Time
Class Method Summary collapse
-
.inheritable ⇒ Array<Class>
This, like Type.inheritable, provides a list of inheritable coercions; however, by default, if the requesting type isn't an Object, it also leaves out the Object type; this is so that types that are incompatible with another type all the way up to the Object don't end up getting coerced incorrectly.
Methods inherited from Type
anonymous?, as, constraint, constraints, inherited, inspect, mappings, matches?, options, register, to_s
Class Method Details
.inheritable ⇒ Array<Class>
This, like Type.inheritable, provides a list of inheritable coercions; however, by default, if the requesting type isn't an Object, it also leaves out the Object type; this is so that types that are incompatible with another type all the way up to the Object don't end up getting coerced incorrectly.
22 23 24 25 26 27 28 |
# File 'lib/mixture/types/object.rb', line 22 def self.inheritable if self == Object super else ancestors - Object.ancestors end end |