Class: Regexp

Inherits:
Object show all
Defined in:
lib/backports/1.8.7/regexp/union.rb,
lib/backports/2.4.0/regexp/match.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.try_convert(obj) ⇒ Object


4
5
6
# File 'lib/backports/1.9.1/regexp/try_convert.rb', line 4

def Regexp.try_convert(obj)
  Backports.try_convert(obj, Regexp, :to_regexp)
end

.union_with_array_argument(*arg) ⇒ Object


5
6
7
8
# File 'lib/backports/1.8.7/regexp/union.rb', line 5

def union_with_array_argument(*arg)
  return union_without_array_argument(*arg) unless arg.size == 1
  union_without_array_argument(*arg.first)
end

Instance Method Details

#match?(*args) ⇒ Boolean

Returns:

  • (Boolean)

3
4
5
# File 'lib/backports/2.4.0/regexp/match.rb', line 3

def match?(*args)
  !match(*args).nil?
end