class Nanoc::Int::RegexpPattern

@api private

Public Class Methods

new(regexp) click to toggle source
# File lib/nanoc/base/entities/pattern.rb, line 52
def initialize(regexp)
  @regexp = regexp
end

Public Instance Methods

captures(identifier) click to toggle source
# File lib/nanoc/base/entities/pattern.rb, line 60
def captures(identifier)
  matches = @regexp.match(identifier.to_s)
  matches && matches.captures
end
match?(identifier) click to toggle source
# File lib/nanoc/base/entities/pattern.rb, line 56
def match?(identifier)
  (identifier.to_s =~ @regexp) != nil
end
to_s() click to toggle source
# File lib/nanoc/base/entities/pattern.rb, line 65
def to_s
  @regexp.to_s
end