Class: Sidewalk::Regexp
- Inherits:
-
REGEXP_BASE
- Object
- Sidewalk::Regexp
- Defined in:
- lib/sidewalk/regexp.rb
Overview
A Regexp class that supports named captures.
This class exists just to give a portable class name to refer to.
-
On Ruby 1.9, this inherits
::Regexp
. -
On Ruby 1.8, this inherits
Oniguruma::ORegexp
(which is basically the same library that Ruby 1.9 uses for::Regexp
)
Class Method Summary collapse
-
.native? ⇒ Boolean
Whether we’re using
::Regexp
. -
.oniguruma? ⇒ Boolean
Whether we’re using
Onigirumua::ORegexp
.
Class Method Details
.native? ⇒ Boolean
Whether we’re using ::Regexp
Inverse of #native?.
46 47 48 |
# File 'lib/sidewalk/regexp.rb', line 46 def self.native? !self.oniguruma? end |
.oniguruma? ⇒ Boolean
Whether we’re using Onigirumua::ORegexp
.
Inverse of #native?.
39 40 41 |
# File 'lib/sidewalk/regexp.rb', line 39 def self.oniguruma? Sidewalk::REGEXP_USING_ONIGURUMA end |