Class: Nanoc::Int::Pattern Private
- Inherits:
-
Object
- Object
- Nanoc::Int::Pattern
- Includes:
- ContractsSupport
- 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.
Direct Known Subclasses
Class Method Summary collapse
- .from(obj) ⇒ Object private
Instance Method Summary collapse
- #captures(_identifier) ⇒ Object private
-
#initialize(_obj) ⇒ Pattern
constructor
private
A new instance of Pattern.
- #match?(_identifier) ⇒ Boolean private
Methods included from ContractsSupport
Constructor Details
#initialize(_obj) ⇒ Pattern
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 Pattern.
20 21 22 |
# File 'lib/nanoc/base/entities/pattern.rb', line 20 def initialize(_obj) raise NotImplementedError end |
Class Method Details
.from(obj) ⇒ 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.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/nanoc/base/entities/pattern.rb', line 7 def self.from(obj) case obj when Nanoc::Int::StringPattern, Nanoc::Int::RegexpPattern obj when String Nanoc::Int::StringPattern.new(obj) when Regexp Nanoc::Int::RegexpPattern.new(obj) else raise ArgumentError, "Do not know how to convert `#{obj.inspect}` into a Nanoc::Pattern" end 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.
28 29 30 |
# File 'lib/nanoc/base/entities/pattern.rb', line 28 def captures(_identifier) raise NotImplementedError 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.
24 25 26 |
# File 'lib/nanoc/base/entities/pattern.rb', line 24 def match?(_identifier) raise NotImplementedError end |