Class: EacRubyUtils::Wildcards

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_ruby_utils/wildcards.rb

Overview

The Wildcards class provides pattern matching with wildcards using regular expressions.

Instance Method Summary collapse

Constructor Details

#initialize(pattern) ⇒ Wildcards

Initializes a new instance of the Wildcards class with the specified pattern.

Parameters:

  • pattern (String)

    The pattern to match against.



9
10
11
# File 'lib/eac_ruby_utils/wildcards.rb', line 9

def initialize(pattern)
  @pattern = pattern
end

Instance Method Details

#match?Boolean

Matches the given string against the pattern.

Parameters:

  • string (String)

    The string to match.

Returns:

  • (Boolean)

    Returns true if the string matches the pattern, otherwise false.



17
# File 'lib/eac_ruby_utils/wildcards.rb', line 17

delegate :match?, to: :regex