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

Version Path
facets-0.9.0 lib/nano/regexp/to_re.rb
facets-1.0.3 packages/core/lib/facet/regexp/to_re.rb
facets-1.0.0 lib/facet/regexp/to_re.rb
facets-1.3.0 lib/facets/core/regexp/to_re.rb
facets-1.1.0 lib/facet/regexp/to_re.rb
facets-1.2.0 lib/facets/core/regexp/to_re.rb
facets-1.2.1 lib/facets/core/regexp/to_re.rb
facets-1.3.2 lib/facets/core/regexp/to_re.rb
facets-1.3.3 lib/facets/core/regexp/to_re.rb
facets-1.3.1 lib/facets/core/regexp/to_re.rb
facets-1.4.1 lib/facets/core/regexp/to_re.rb
facets-1.4.0 lib/facets/core/regexp/to_re.rb
facets-1.4.2 lib/facets/core/regexp/to_re.rb
facets-1.4.3 lib/facets/core/regexp/to_re.rb
facets-1.4.4 lib/facets/core/regexp/to_re.rb
facets-1.4.5 lib/facets/core/regexp/to_re.rb
facets-1.7.30 lib/facets/core/regexp/to_re.rb
facets-1.7.0 lib/facets/core/regexp/to_re.rb
facets-1.7.38 lib/facets/core/regexp/to_re.rb
facets-1.7.46 lib/facets/core/regexp/to_re.rb