Class: Nanoc::Int::StringPattern Private
- Defined in:
- lib/nanoc/base/entities/pattern.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- MATCH_OPTS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
File::FNM_PATHNAME | File::FNM_EXTGLOB
Instance Method Summary collapse
- #captures(_identifier) ⇒ Object private
-
#initialize(string) ⇒ StringPattern
constructor
private
A new instance of StringPattern.
- #match?(identifier) ⇒ Boolean private
- #to_s ⇒ Object private
Methods inherited from Pattern
Methods included from ContractsSupport
Constructor Details
#initialize(string) ⇒ StringPattern
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of StringPattern.
38 39 40 |
# File 'lib/nanoc/base/entities/pattern.rb', line 38 def initialize(string) @string = string end |
Instance Method Details
#captures(_identifier) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
48 49 50 |
# File 'lib/nanoc/base/entities/pattern.rb', line 48 def captures(_identifier) nil end |
#match?(identifier) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
43 44 45 |
# File 'lib/nanoc/base/entities/pattern.rb', line 43 def match?(identifier) File.fnmatch(@string, identifier.to_s, MATCH_OPTS) end |
#to_s ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
53 54 55 |
# File 'lib/nanoc/base/entities/pattern.rb', line 53 def to_s @string end |