Class: AssetFinder::PathPattern

Inherits:
Object
  • Object
show all
Defined in:
lib/asset_finder/path_pattern.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pattern:) ⇒ PathPattern

Returns a new instance of PathPattern.



5
6
7
8
9
# File 'lib/asset_finder/path_pattern.rb', line 5

def initialize(pattern:)
  @pattern = pattern

  freeze
end

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



3
4
5
# File 'lib/asset_finder/path_pattern.rb', line 3

def pattern
  @pattern
end

Instance Method Details

#match(path:) ⇒ Object



15
16
17
# File 'lib/asset_finder/path_pattern.rb', line 15

def match(path:)
  path.match(pattern)
end

#match?(path:) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/asset_finder/path_pattern.rb', line 11

def match?(path:)
  path.match?(pattern)
end