Class: Utils::Patterns::FuzzyPattern
- Defined in:
- lib/utils/patterns.rb
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ FuzzyPattern
constructor
A new instance of FuzzyPattern.
Methods inherited from Pattern
Constructor Details
#initialize(opts = {}) ⇒ FuzzyPattern
Returns a new instance of FuzzyPattern.
18 19 20 21 22 23 24 |
# File 'lib/utils/patterns.rb', line 18 def initialize(opts ={}) super r = @pattern.split(//).map { |x| "(#{Regexp.quote(x)})" } * '.*?' @matcher = Regexp.new( "\\A(?:.*/.*?#{r}|.*#{r})", @icase ? Regexp::IGNORECASE : 0) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Utils::Patterns::Pattern