Class: RegexSpec
- Defined in:
- lib/puppet/vendor/pathspec/lib/pathspec/regexspec.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Spec
Instance Method Summary collapse
- #inclusive? ⇒ Boolean
-
#initialize(regex) ⇒ RegexSpec
constructor
A new instance of RegexSpec.
- #match(path) ⇒ Object
Constructor Details
#initialize(regex) ⇒ RegexSpec
Returns a new instance of RegexSpec.
4 5 6 7 8 |
# File 'lib/puppet/vendor/pathspec/lib/pathspec/regexspec.rb', line 4 def initialize(regex) @regex = Regexp.compile regex super end |
Instance Method Details
#inclusive? ⇒ Boolean
10 11 12 |
# File 'lib/puppet/vendor/pathspec/lib/pathspec/regexspec.rb', line 10 def inclusive? true end |
#match(path) ⇒ Object
14 15 16 |
# File 'lib/puppet/vendor/pathspec/lib/pathspec/regexspec.rb', line 14 def match(path) @regex.match(path) if @regex end |