Class: Utils::Patterns::RegexpPattern
- Defined in:
- lib/utils/patterns.rb
Overview
A regular expression pattern matcher that performs exact string matching with optional case sensitivity.
This class extends the base Pattern class to provide functionality for creating and using regular expression patterns. It compiles the provided pattern into a Regexp object that can be used for matching operations throughout the application. The pattern matching behavior is influenced by the case sensitivity configuration inherited from the parent class.
Instance Attribute Summary
Attributes inherited from Pattern
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Regexp
constructor
Initializes a regular expression pattern matcher with the specified options.
Methods inherited from Pattern
Constructor Details
#initialize(opts = {}) ⇒ Regexp
Initializes a regular expression pattern matcher with the specified options.
This method sets up a regular expression object based on the pattern string and case sensitivity configuration that was previously initialized in the parent class. It compiles the pattern into a Regexp object that can be used for matching operations throughout the pattern matching process.
128 129 130 131 132 133 |
# File 'lib/utils/patterns.rb', line 128 def initialize(opts = {}) super @matcher = Regexp.new( @pattern, @icase ? Regexp::IGNORECASE : 0 ) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Utils::Patterns::Pattern