Class: Rigor::Type::Bot

Inherits:
Object
  • Object
show all
Defined in:
lib/rigor/type/bot.rb

Overview

The bottom of the value lattice: contains no values. The result type of expressions that cannot terminate normally. See docs/type-specification/special-types.md.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.instanceObject



12
13
14
# File 'lib/rigor/type/bot.rb', line 12

def instance
  @instance ||= new.freeze
end

Instance Method Details

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



43
44
45
# File 'lib/rigor/type/bot.rb', line 43

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

#accepts(other, mode: :gradual) ⇒ Object



39
40
41
# File 'lib/rigor/type/bot.rb', line 39

def accepts(other, mode: :gradual)
  Inference::Acceptance.accepts(self, other, mode: mode)
end

#botObject



31
32
33
# File 'lib/rigor/type/bot.rb', line 31

def bot
  Trinary.yes
end

#describe(_verbosity = :short) ⇒ Object



19
20
21
# File 'lib/rigor/type/bot.rb', line 19

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

#dynamicObject



35
36
37
# File 'lib/rigor/type/bot.rb', line 35

def dynamic
  Trinary.no
end

#erase_to_rbsObject



23
24
25
# File 'lib/rigor/type/bot.rb', line 23

def erase_to_rbs
  "bot"
end

#hashObject



48
49
50
# File 'lib/rigor/type/bot.rb', line 48

def hash
  Bot.hash
end

#inspectObject



52
53
54
# File 'lib/rigor/type/bot.rb', line 52

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

#topObject



27
28
29
# File 'lib/rigor/type/bot.rb', line 27

def top
  Trinary.no
end