class Nanoc::RuleDSL::Rule

Attributes

pattern[R]
rep_name[R]

Public Class Methods

new(pattern, rep_name, block) click to toggle source
# File lib/nanoc/rule_dsl/rule.rb, line 14
def initialize(pattern, rep_name, block)
  @pattern = pattern
  @rep_name = rep_name.to_sym
  @block = block
end

Public Instance Methods

applicable_to?(item) click to toggle source
# File lib/nanoc/rule_dsl/rule.rb, line 21
def applicable_to?(item)
  @pattern.match?(item.identifier)
end
matches(identifier) click to toggle source
# File lib/nanoc/rule_dsl/rule.rb, line 27
def matches(identifier)
  @pattern.captures(identifier)
end