Class: RDL::Type::WildQuery

Inherits:
TypeQuery show all
Defined in:
lib/rdl/types/wild_query.rb

Constant Summary collapse

@@cache =
nil

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Type

#canonical, leq, #nil_type?, #optional?, #to_contract, #vararg?

Class Method Details

.__new__Object



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

alias :__new__ :new

.newObject



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

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

Instance Method Details

#<=(other) ⇒ Object



26
27
28
29
30
# File 'lib/rdl/types/wild_query.rb', line 26

def <=(other)
  other = other.type if other.is_a? DependentArgType
  other = other.canonical
  return self == other
end

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



18
19
20
21
22
# File 'lib/rdl/types/wild_query.rb', line 18

def ==(other)
  return false if other.nil?
  other = other.canonical
  return (other.instance_of? WildQuery)
end

#match(other) ⇒ Object



32
33
34
# File 'lib/rdl/types/wild_query.rb', line 32

def match(other)
  return true
end

#to_sObject



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

def to_s
  "*"
end