Class: RDL::Type::BotType

Inherits:
RDL::Type show all
Defined in:
lib/rdl/types/bot.rb

Constant Summary collapse

@@cache =
nil

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RDL::Type

expand_product

Constructor Details

#initializeBotType

Returns a new instance of BotType.



14
15
16
# File 'lib/rdl/types/bot.rb', line 14

def initialize
  super
end

Class Method Details

.__new__Object



6
# File 'lib/rdl/types/bot.rb', line 6

alias :__new__ :new

.newObject



9
10
11
12
# File 'lib/rdl/types/bot.rb', line 9

def self.new
  @@cache = BotType.__new__ unless @@cache
  return @@cache
end

Instance Method Details

#<=(other) ⇒ Object



35
36
37
# File 'lib/rdl/types/bot.rb', line 35

def <=(other)
  return Type.leq(self, other)
end

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



22
23
24
# File 'lib/rdl/types/bot.rb', line 22

def ==(other)
  other.instance_of? BotType
end

#hashObject



48
49
50
# File 'lib/rdl/types/bot.rb', line 48

def hash
  13
end

#instantiate(inst) ⇒ Object



44
45
46
# File 'lib/rdl/types/bot.rb', line 44

def instantiate(inst)
  return self
end

#match(other) ⇒ Object



28
29
30
31
32
33
# File 'lib/rdl/types/bot.rb', line 28

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

Returns:

  • (Boolean)


39
40
41
42
# File 'lib/rdl/types/bot.rb', line 39

def member?(obj, *args)
  # There are no values of this type (note nil does *not* have type %bot)
  false
end

#to_sObject



18
19
20
# File 'lib/rdl/types/bot.rb', line 18

def to_s
  "%bot"
end