Sha256: 1f0acbd849fb377bc5ca43e890bde39719e1a3bcbeedfdabf0d5e857fbf635b7
Contents?: true
Size: 686 Bytes
Versions: 26
Compression:
Stored size: 686 Bytes
Contents
class Regexp # 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/ # def to_re( esc=false ) self # Of course, things really should know how to say "I" ;) end end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCRegexp < Test::Unit::TestCase def test_to_re r = /0..10/ assert_equal( r, r.to_re ) end end =end
Version data entries
26 entries across 26 versions & 1 rubygems