Sha256: 033613f50d15dd72641849db827be53db83f80c7463bcc62cf9a9f3ab82c3e69

Contents?: true

Size: 691 Bytes

Versions: 41

Compression:

Stored size: 691 Bytes

Contents

# frozen_string_literal: true

module Nanoc
  class MutableLayoutCollectionView < Nanoc::MutableIdentifiableCollectionView
    # @api private
    def view_class
      Nanoc::MutableLayoutView
    end

    # Creates a new layout and adds it to the site’s collection of layouts.
    #
    # @param [String] content The layout content.
    #
    # @param [Hash] attributes A hash containing this layout's attributes.
    #
    # @param [Nanoc::Identifier, String] identifier This layout's identifier.
    #
    # @return [self]
    def create(content, attributes, identifier)
      @objects = @objects.add(Nanoc::Int::Layout.new(content, attributes, identifier))
      self
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
nanoc-4.11.0 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.10.4 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.10.3 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.10.2 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.10.1 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.10.0 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.9.9 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.9.8 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.9.7 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.9.6 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.9.5 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.9.4 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.9.3 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.9.2 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.9.1 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.9.0 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.8.19 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.8.18 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.8.17 lib/nanoc/base/views/mutable_layout_collection_view.rb
nanoc-4.8.16 lib/nanoc/base/views/mutable_layout_collection_view.rb