Class: AssetFinder::PathPattern
- Inherits:
-
Object
- Object
- AssetFinder::PathPattern
- Defined in:
- lib/asset_finder/path_pattern.rb
Instance Attribute Summary collapse
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
Instance Method Summary collapse
-
#initialize(pattern:) ⇒ PathPattern
constructor
A new instance of PathPattern.
- #match(path:) ⇒ Object
- #match?(path:) ⇒ Boolean
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
#pattern ⇒ Object (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
11 12 13 |
# File 'lib/asset_finder/path_pattern.rb', line 11 def match?(path:) path.match?(pattern) end |