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.
Methods inherited from MutableIdentifiableCollectionView
Methods inherited from IdentifiableCollectionView
Methods inherited from View
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.
26 27 28 29 30 |
# File 'lib/nanoc/base/views/mutable_item_collection_view.rb', line 26 def create(content, attributes, identifier, binary: false, filename: nil) content = Nanoc::Int::Content.create(content, binary: binary, filename: filename) @objects = @objects.add(Nanoc::Int::Item.new(content, attributes, identifier)) self end |