Class: Typisch::Type::Any
- Inherits:
-
Union
- Object
- Typisch::Type
- Union
- Typisch::Type::Any
- Defined in:
- lib/typisch/union.rb
Overview
The Any (or ‘top’) type is just a union of all the top types of the various Type::Constructor subclasses:
Constant Summary collapse
- INSTANCE =
new
Instance Attribute Summary
Attributes inherited from Union
Attributes inherited from Typisch::Type
Instance Method Summary collapse
- #canonicalize! ⇒ Object
-
#check_type(instance) ⇒ Object
skip some unnecessary work checking different alternatives, since we know everything works here:.
-
#initialize ⇒ Any
constructor
A new instance of Any.
- #to_s ⇒ Object
Methods inherited from Union
#excluding_null, #shallow_check_type, #to_string
Methods inherited from Typisch::Type
#<, #<=, #<=>, #==, #===, #>, #>=, #alternative_types, #annotations, #annotations=, #excluding_null, #inspect, #recursive?, #shallow_check_type, #subexpression_types, subtype?, #target, #to_string
Constructor Details
#initialize ⇒ Any
Returns a new instance of Any.
57 58 59 |
# File 'lib/typisch/union.rb', line 57 def initialize super(*Constructor::CONSTRUCTOR_TYPE_SUBCLASSES.map {|klass| klass.top_type(self)}) end |
Instance Method Details
#canonicalize! ⇒ Object
63 |
# File 'lib/typisch/union.rb', line 63 def canonicalize!; end |
#check_type(instance) ⇒ Object
skip some unnecessary work checking different alternatives, since we know everything works here:
67 68 69 |
# File 'lib/typisch/union.rb', line 67 def check_type(instance) true end |
#to_s ⇒ Object
61 |
# File 'lib/typisch/union.rb', line 61 def to_s(*); @name.inspect; end |