class Nanoc::RuleDSL::RoutingRule

Attributes

snapshot_name[R]

Public Class Methods

new(pattern, rep_name, block, snapshot_name: nil) click to toggle source
Calls superclass method
# 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

Public Instance Methods

apply_to(rep, site:, view_context:) click to toggle 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