Class: Nanoc::Core::PrefixedDataSource
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
#initialize(data_source, items_prefix, layouts_prefix) ⇒ PrefixedDataSource
Returns a new instance of PrefixedDataSource.
6
7
8
9
10
11
12
|
# File 'lib/nanoc/core/prefixed_data_source.rb', line 6
def initialize(data_source, items_prefix, layouts_prefix)
super({}, '/', '/', {})
@data_source = data_source
@items_prefix = items_prefix
@layouts_prefix = layouts_prefix
end
|
Instance Method Details
#item_changes ⇒ Object
26
27
28
|
# File 'lib/nanoc/core/prefixed_data_source.rb', line 26
def item_changes
@data_source.item_changes
end
|
#items ⇒ Object
14
15
16
17
18
|
# File 'lib/nanoc/core/prefixed_data_source.rb', line 14
def items
@data_source.items.map do |d|
d.with_identifier_prefix(@items_prefix)
end
end
|
#layout_changes ⇒ Object
30
31
32
|
# File 'lib/nanoc/core/prefixed_data_source.rb', line 30
def layout_changes
@data_source.layout_changes
end
|
#layouts ⇒ Object
20
21
22
23
24
|
# File 'lib/nanoc/core/prefixed_data_source.rb', line 20
def layouts
@data_source.layouts.map do |d|
d.with_identifier_prefix(@layouts_prefix)
end
end
|