Class: Rigor::Type::Top
- Inherits:
-
Object
- Object
- Rigor::Type::Top
- Defined in:
- lib/rigor/type/top.rb
Overview
The top of the value lattice: contains every value, including untyped boundaries. See docs/type-specification/special-types.md.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #accepts(other, mode: :gradual) ⇒ Object
- #bot ⇒ Object
- #describe(_verbosity = :short) ⇒ Object
- #dynamic ⇒ Object
- #erase_to_rbs ⇒ Object
- #hash ⇒ Object
- #inspect ⇒ Object
- #top ⇒ Object
Class Method Details
.instance ⇒ Object
11 12 13 |
# File 'lib/rigor/type/top.rb', line 11 def instance @instance ||= new.freeze end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
42 43 44 |
# File 'lib/rigor/type/top.rb', line 42 def ==(other) other.is_a?(Top) end |
#accepts(other, mode: :gradual) ⇒ Object
38 39 40 |
# File 'lib/rigor/type/top.rb', line 38 def accepts(other, mode: :gradual) Inference::Acceptance.accepts(self, other, mode: mode) end |
#describe(_verbosity = :short) ⇒ Object
18 19 20 |
# File 'lib/rigor/type/top.rb', line 18 def describe(_verbosity = :short) "top" end |
#erase_to_rbs ⇒ Object
22 23 24 |
# File 'lib/rigor/type/top.rb', line 22 def erase_to_rbs "top" end |
#hash ⇒ Object
47 48 49 |
# File 'lib/rigor/type/top.rb', line 47 def hash Top.hash end |
#inspect ⇒ Object
51 52 53 |
# File 'lib/rigor/type/top.rb', line 51 def inspect "#<Rigor::Type::Top>" end |