Class: RDL::Type::TopType
Constant Summary collapse
- @@cache =
nil
Class Method Summary collapse
Instance Method Summary collapse
- #<=(other) ⇒ Object
- #==(other) ⇒ Object (also: #eql?)
- #copy ⇒ Object
- #hash ⇒ Object
-
#initialize ⇒ TopType
constructor
A new instance of TopType.
- #instantiate(inst) ⇒ Object
- #match(other) ⇒ Object
- #member?(obj, *args) ⇒ Boolean
- #to_s ⇒ Object
- #widen ⇒ Object
Methods included from RDL::Type
Constructor Details
#initialize ⇒ TopType
Returns a new instance of TopType.
14 15 16 |
# File 'lib/rdl/types/top.rb', line 14 def initialize super end |
Class Method Details
.__new__ ⇒ Object
6 |
# File 'lib/rdl/types/top.rb', line 6 alias :__new__ :new |
Instance Method Details
#<=(other) ⇒ Object
37 38 39 |
# File 'lib/rdl/types/top.rb', line 37 def <=(other) return Type.leq(self, other) end |
#==(other) ⇒ Object Also known as: eql?
22 23 24 25 26 |
# File 'lib/rdl/types/top.rb', line 22 def ==(other) return false if other.nil? other = other.canonical other.instance_of? TopType end |
#copy ⇒ Object
55 56 57 |
# File 'lib/rdl/types/top.rb', line 55 def copy return self end |
#hash ⇒ Object
59 60 61 |
# File 'lib/rdl/types/top.rb', line 59 def hash 17 end |
#instantiate(inst) ⇒ Object
47 48 49 |
# File 'lib/rdl/types/top.rb', line 47 def instantiate(inst) return self end |
#match(other) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/rdl/types/top.rb', line 30 def match(other) other = other.canonical other = other.type if other.instance_of? AnnotatedArgType return true if other.instance_of? WildQuery return self == other end |
#member?(obj, *args) ⇒ Boolean
41 42 43 44 45 |
# File 'lib/rdl/types/top.rb', line 41 def member?(obj, *args) t = RDL::Util.rdl_type obj return t <= self if t true end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/rdl/types/top.rb', line 18 def to_s "%any" end |
#widen ⇒ Object
51 52 53 |
# File 'lib/rdl/types/top.rb', line 51 def widen return self end |