Class: Nanoc::Core::MutableItemCollectionView
- Inherits:
-
MutableIdentifiableCollectionView
- Object
- View
- IdentifiableCollectionView
- MutableIdentifiableCollectionView
- Nanoc::Core::MutableItemCollectionView
- Defined in:
- lib/nanoc/core/mutable_item_collection_view.rb
Constant Summary
Constants inherited from IdentifiableCollectionView
IdentifiableCollectionView::NOTHING
Instance Method Summary collapse
-
#create(content, attributes, identifier, binary: false, filename: nil) ⇒ self
Creates a new item and adds it to the site’s collection of items.
- #view_class ⇒ Object private
Methods inherited from MutableIdentifiableCollectionView
Methods inherited from IdentifiableCollectionView
#[], #_unwrap, #each, #find_all, #initialize, #size, #where
Methods inherited from View
#_context, #_unwrap, #frozen?, #initialize, #inspect
Methods included from ContractsSupport
enabled?, included, setup_once, warn_about_performance
Constructor Details
This class inherits a constructor from Nanoc::Core::IdentifiableCollectionView
Instance Method Details
#create(content, attributes, identifier, binary: false, filename: nil) ⇒ self
Creates a new item and adds it to the site’s collection of items.
27 28 29 30 31 |
# File 'lib/nanoc/core/mutable_item_collection_view.rb', line 27 def create(content, attributes, identifier, binary: false, filename: nil) content = Nanoc::Core::Content.create(content, binary:, filename:) @objects = @objects.add(Nanoc::Core::Item.new(content, attributes, identifier)) self end |
#view_class ⇒ Object
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.
7 8 9 |
# File 'lib/nanoc/core/mutable_item_collection_view.rb', line 7 def view_class Nanoc::Core::MutableItemView end |