Class: Rigor::Type::Top

Inherits:
Object
  • Object
show all
Includes:
AcceptanceRouter
Defined in:
lib/rigor/type/top.rb,
sig/rigor/type.rbs

Overview

The top of the value lattice: contains every value, including untyped boundaries. See docs/type-specification/special-types.md.

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.instanceTop (readonly)

Returns the value of attribute instance.

Returns:



15
16
17
# File 'lib/rigor/type/top.rb', line 15

def instance
  @instance
end

Instance Method Details

#==(other) ⇒ Boolean Also known as: eql?

Parameters:

  • other (Object)

Returns:

  • (Boolean)


42
43
44
# File 'lib/rigor/type/top.rb', line 42

def ==(other)
  other.is_a?(Top)
end

#acceptsAcceptsResult

Parameters:

  • other (Type::t)
  • mode: (accepts_mode)

Returns:



37
# File 'sig/rigor/type.rbs', line 37

def accepts: (Type::t other, ?mode: accepts_mode) -> AcceptsResult

#botTrinary

Returns:



32
33
34
# File 'lib/rigor/type/top.rb', line 32

def bot
  Trinary.no
end

#describe(_verbosity = :short) ⇒ String

Parameters:

  • verbosity (Symbol)

Returns:

  • (String)


20
21
22
# File 'lib/rigor/type/top.rb', line 20

def describe(_verbosity = :short)
  "top"
end

#dynamicTrinary

Returns:



36
37
38
# File 'lib/rigor/type/top.rb', line 36

def dynamic
  Trinary.no
end

#erase_to_rbs"top"

Returns:



24
25
26
# File 'lib/rigor/type/top.rb', line 24

def erase_to_rbs
  "top"
end

#hashInteger

Returns:

  • (Integer)


47
48
49
# File 'lib/rigor/type/top.rb', line 47

def hash
  Top.hash
end

#inspect"#<Rigor::Type::Top>"

Returns:



51
52
53
# File 'lib/rigor/type/top.rb', line 51

def inspect
  "#<Rigor::Type::Top>"
end

#topTrinary

Returns:



28
29
30
# File 'lib/rigor/type/top.rb', line 28

def top
  Trinary.yes
end