Class: Nanoc::Int::ItemRepBuilder Private

Inherits:
Object
  • Object
show all
Defined in:
lib/nanoc/base/services/item_rep_builder.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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(site, action_provider, reps) ⇒ ItemRepBuilder

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



6
7
8
9
10
# File 'lib/nanoc/base/services/item_rep_builder.rb', line 6

def initialize(site, action_provider, reps)
  @site = site
  @action_provider = action_provider
  @reps = reps
end

Instance Attribute Details

#repsObject (readonly)

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.



4
5
6
# File 'lib/nanoc/base/services/item_rep_builder.rb', line 4

def reps
  @reps
end

Instance Method Details

#runObject

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.



12
13
14
15
16
17
18
19
20
# File 'lib/nanoc/base/services/item_rep_builder.rb', line 12

def run
  @site.items.each do |item|
    @action_provider.rep_names_for(item).each do |rep_name|
      @reps << Nanoc::Int::ItemRep.new(item, rep_name)
    end
  end

  Nanoc::Int::ItemRepRouter.new(@reps, @action_provider, @site).run
end