Class: Nanoc::MutableLayoutCollectionView

Inherits:
MutableIdentifiableCollectionView show all
Defined in:
lib/nanoc/base/views/mutable_layout_collection_view.rb

Instance Method Summary collapse

Methods inherited from MutableIdentifiableCollectionView

#delete_if

Methods inherited from IdentifiableCollectionView

#[], #each, #find_all, #size

Methods inherited from View

#_context, #frozen?

Instance Method Details

#create(content, attributes, identifier) ⇒ self

Creates a new layout and adds it to the site’s collection of layouts.

Parameters:

  • content (String)

    The layout content.

  • attributes (Hash)

    A hash containing this layout’s attributes.

  • identifier (Nanoc::Identifier, String)

    This layout’s identifier.

Returns:

  • (self)


17
18
19
20
# File 'lib/nanoc/base/views/mutable_layout_collection_view.rb', line 17

def create(content, attributes, identifier)
  @objects << Nanoc::Int::Layout.new(content, attributes, identifier)
  self
end