Method: Regexp#to_re

Defined in:
lib/core/facets/regexp/to_re.rb

#to_re(esc = false) ⇒ Object

Simply returns itself. Helpful when converting strings to regular expressions, where regexp might occur as well –in the same vien as using #to_s on symbols. The parameter is actaully a dummy parameter to coincide with String#to_re.

/abc/.to_re  #=> /abc/

CREDIT: Trans



24
25
26
# File 'lib/core/facets/regexp/to_re.rb', line 24

def to_re(esc=false)
  self  # Of course, things really should know how to say "I" ;)
end