Sha256: 36c618aa049aa63d0081d552e150f0295247942fc4b85e2ed3fbf0f2796b30dd

Contents?: true

Size: 1.03 KB

Versions: 41

Compression:

Stored size: 1.03 KB

Contents

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::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::Int::Content.create(content, binary: binary, filename: filename)
      @objects << Nanoc::Int::Item.new(content, attributes, identifier)
      self
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
nanoc-4.6.1 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.6.0 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.5.4 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.5.3 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.5.2 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.5.1 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.5.0 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.4.7 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.4.6 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.4.5 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.4.4 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.4.3 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.4.2 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.4.1 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.4.0 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.3.8 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.3.7 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.3.6 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.3.5 lib/nanoc/base/views/mutable_item_collection_view.rb
nanoc-4.3.4 lib/nanoc/base/views/mutable_item_collection_view.rb