class Nanoc::RuleDSL::RoutingRule
Attributes
Public Class Methods
Source
# File lib/nanoc/rule_dsl/routing_rule.rb, line 11 def initialize(pattern, rep_name, block, snapshot_name: nil) super(pattern, rep_name, block) @snapshot_name = snapshot_name end
Calls superclass method
Public Instance Methods
Source
# File lib/nanoc/rule_dsl/routing_rule.rb, line 21 def apply_to(rep, site:, view_context:) context = Nanoc::RuleDSL::RoutingRuleContext.new( rep:, site:, view_context:, ) context.instance_exec(matches(rep.item.identifier), &@block) end