Module: Ruby3BackwardCompatibility::ObjectCompatibility

Defined in:
lib/ruby3_backward_compatibility/compatibility/object.rb

Instance Method Summary collapse

Instance Method Details

#=~(regexp) ⇒ Object

Make the match operator work on arbitrary receivers again.



13
14
15
16
17
18
# File 'lib/ruby3_backward_compatibility/compatibility/object.rb', line 13

def =~(regexp)
  if Warning[:deprecated]
    Warning.warn("deprecated Object#=~ is called on #{self.class}; it always returns nil")
  end
  nil
end

#taintObject

Taint/untaint used to be a noop for a while.



4
5
6
# File 'lib/ruby3_backward_compatibility/compatibility/object.rb', line 4

def taint
  self
end

#untaintObject



8
9
10
# File 'lib/ruby3_backward_compatibility/compatibility/object.rb', line 8

def untaint
  self
end