Class: Nanoc::MutableItemCollectionView
- Inherits:
-
MutableIdentifiableCollectionView
- Object
- View
- IdentifiableCollectionView
- MutableIdentifiableCollectionView
- Nanoc::MutableItemCollectionView
- Defined in:
- lib/nanoc/base/views/mutable_item_collection_view.rb
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
#[], #each, #find_all, #initialize, #size, #unwrap
Methods inherited from View
#_context, #frozen?, #initialize, #inspect, #unwrap
Constructor Details
This class inherits a constructor from Nanoc::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.
24 25 26 27 28 |
# File 'lib/nanoc/base/views/mutable_item_collection_view.rb', line 24 def create(content, attributes, identifier, binary: false, filename: nil) content = Nanoc::Int::Content.create(content, binary: binary, filename: filename) @objects << Nanoc::Int::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.
4 5 6 |
# File 'lib/nanoc/base/views/mutable_item_collection_view.rb', line 4 def view_class Nanoc::MutableItemView end |