Class: Nanoc::Core::InMemoryDataSource
- Inherits:
-
DataSource
- Object
- DataSource
- Nanoc::Core::InMemoryDataSource
- Includes:
- ContractsSupport
- Defined in:
- lib/nanoc/core/in_memory_data_source.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#layouts ⇒ Object
readonly
Returns the value of attribute layouts.
Attributes inherited from DataSource
#config, #items_root, #layouts_root
Instance Method Summary collapse
-
#initialize(items, layouts, orig_data_source = nil) ⇒ InMemoryDataSource
constructor
A new instance of InMemoryDataSource.
- #item_changes ⇒ Object
- #layout_changes ⇒ Object
Methods included from ContractsSupport
enabled?, included, setup_once, warn_about_performance
Methods inherited from DataSource
#down, #new_item, #new_layout, #unuse, #up, #use
Constructor Details
#initialize(items, layouts, orig_data_source = nil) ⇒ InMemoryDataSource
Returns a new instance of InMemoryDataSource.
12 13 14 15 16 17 18 |
# File 'lib/nanoc/core/in_memory_data_source.rb', line 12 def initialize(items, layouts, orig_data_source = nil) super({}, '/', '/', {}) @items = items @layouts = layouts @orig_data_source = orig_data_source end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
8 9 10 |
# File 'lib/nanoc/core/in_memory_data_source.rb', line 8 def items @items end |
#layouts ⇒ Object (readonly)
Returns the value of attribute layouts.
9 10 11 |
# File 'lib/nanoc/core/in_memory_data_source.rb', line 9 def layouts @layouts end |
Instance Method Details
#item_changes ⇒ Object
20 21 22 |
# File 'lib/nanoc/core/in_memory_data_source.rb', line 20 def item_changes @orig_data_source ? @orig_data_source.item_changes : super end |
#layout_changes ⇒ Object
24 25 26 |
# File 'lib/nanoc/core/in_memory_data_source.rb', line 24 def layout_changes @orig_data_source ? @orig_data_source.layout_changes : super end |