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 Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.instanceObject (readonly)

Returns the value of attribute instance.



17
18
19
# File 'lib/rigor/type/bot.rb', line 17

def instance
  @instance
end

Instance Method Details

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



46
47
48
# File 'lib/rigor/type/bot.rb', line 46

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

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



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

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

#botObject



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

def bot
  Trinary.yes
end

#describe(_verbosity = :short) ⇒ Object



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

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

#dynamicObject



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

def dynamic
  Trinary.no
end

#erase_to_rbsObject



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

def erase_to_rbs
  "bot"
end

#hashObject



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

def hash
  Bot.hash
end

#inspectObject



55
56
57
# File 'lib/rigor/type/bot.rb', line 55

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

#topObject



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

def top
  Trinary.no
end