Class: Nanoc::RuleDSL::RuleContext Private

Inherits:
Core::Context
  • Object
show all
Includes:
Core::ContractsSupport
Defined in:
lib/nanoc/rule_dsl/rule_context.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

CompilationRuleContext, RoutingRuleContext

Instance Method Summary collapse

Constructor Details

#initialize(rep:, site:, view_context:) ⇒ RuleContext

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 RuleContext.



12
13
14
15
16
17
18
19
20
21
# File 'lib/nanoc/rule_dsl/rule_context.rb', line 12

def initialize(rep:, site:, view_context:)
  super({
    item: Nanoc::Core::BasicItemView.new(rep.item, view_context),
    rep: Nanoc::Core::BasicItemRepView.new(rep, view_context),
    item_rep: Nanoc::Core::BasicItemRepView.new(rep, view_context),
    items: Nanoc::Core::ItemCollectionWithoutRepsView.new(site.items, view_context),
    layouts: Nanoc::Core::LayoutCollectionView.new(site.layouts, view_context),
    config: Nanoc::Core::ConfigView.new(site.config, view_context),
  })
end