Sha256: b4303da09be1a3bbdb13cc9f320911f195509c567c8afd188b1f920136d0f2fe
Contents?: true
Size: 1.08 KB
Versions: 12
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true module Nanoc class MutableItemCollectionView < Nanoc::MutableIdentifiableCollectionView # @api private def view_class Nanoc::MutableItemView end # Creates a new item and adds it to the site’s collection of items. # # @param [String] content The uncompiled item content (if it is a textual # item) or the path to the filename containing the content (if it is a # binary item). # # @param [Hash] attributes A hash containing this item's attributes. # # @param [Nanoc::Core::Identifier, String] identifier This item's identifier. # # @param [Boolean] binary Whether or not this item is binary # # @param [String] filename Absolute path to the file # containing this content (if any) # # @return [self] def create(content, attributes, identifier, binary: false, filename: nil) content = Nanoc::Core::Content.create(content, binary: binary, filename: filename) @objects = @objects.add(Nanoc::Core::Item.new(content, attributes, identifier)) self end end end
Version data entries
12 entries across 12 versions & 1 rubygems