Class: Mustermann::Regular
- Inherits:
-
RegexpBased
- Object
- Pattern
- RegexpBased
- Mustermann::Regular
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/mustermann-3.0.0/lib/mustermann/regular.rb
Overview
Regexp pattern implementation.
Constant Summary
Constants included from Mustermann
CompileError, DEFAULT_TYPE, Error, ExpandError, ParseError
Instance Attribute Summary
Attributes inherited from RegexpBased
Attributes inherited from Pattern
Instance Method Summary collapse
-
#initialize(string, check_anchors: true, **options) ⇒ Pattern
constructor
A new instance of Pattern.
Methods inherited from RegexpBased
Methods inherited from Pattern
#+, #==, #===, #=~, #eql?, #expand, #hash, #match, #named_captures, #names, new, #params, #peek, #peek_match, #peek_params, #peek_size, supported?, supported_options, #to_proc, #to_s, #to_templates, #|
Methods included from Mustermann
Constructor Details
#initialize(string, check_anchors: true, **options) ⇒ Pattern
Returns a new instance of Pattern.
22 23 24 25 26 27 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/mustermann-3.0.0/lib/mustermann/regular.rb', line 22 def initialize(string, check_anchors: true, **) string = $1 if string.to_s =~ /\A\(\?\-mix\:(.*)\)\Z/ && string.inspect == "/#$1/" string = string.source.gsub!(/(?<!\\)(?:\s|#.*$)/, '') if extended_regexp?(string) @check_anchors = check_anchors super(string, **) end |