Class: Nanoc::Core::AggregateDataSource
Instance Attribute Summary
Attributes inherited from DataSource
#config, #items_root, #layouts_root
Instance Method Summary
collapse
Methods inherited from DataSource
#down, #new_item, #new_layout, #unuse, #up, #use
Constructor Details
Returns a new instance of AggregateDataSource.
6
7
8
9
10
11
|
# File 'lib/nanoc/core/aggregate_data_source.rb', line 6
def initialize(data_sources, config)
super({}, '/', '/', {})
@data_sources = data_sources
@config = config
end
|
Instance Method Details
#item_changes ⇒ Object
27
28
29
|
# File 'lib/nanoc/core/aggregate_data_source.rb', line 27
def item_changes
SlowEnumeratorTools.merge(@data_sources.map(&:item_changes))
end
|
#items ⇒ Object
13
14
15
16
17
18
|
# File 'lib/nanoc/core/aggregate_data_source.rb', line 13
def items
@_items ||= begin
objs = @data_sources.flat_map(&:items)
Nanoc::Core::ItemCollection.new(@config, objs)
end
end
|
#layout_changes ⇒ Object
31
32
33
|
# File 'lib/nanoc/core/aggregate_data_source.rb', line 31
def layout_changes
SlowEnumeratorTools.merge(@data_sources.map(&:layout_changes))
end
|
#layouts ⇒ Object
20
21
22
23
24
25
|
# File 'lib/nanoc/core/aggregate_data_source.rb', line 20
def layouts
@_layouts ||= begin
objs = @data_sources.flat_map(&:layouts)
Nanoc::Core::LayoutCollection.new(@config, objs)
end
end
|