Class Nanoc::Layout
In: lib/nanoc/base/source_data/layout.rb
Parent: Object

Represents a layout in a nanoc site. It has content, attributes, an identifier and a modification time (to speed up compilation).

Methods

==   []   checksum   eql?   freeze   hash   inspect   marshal_dump   marshal_load   mtime   new   reference   type  

Attributes

attributes  [R]  @return [Hash] This layout‘s attributes
identifier  [RW]  @return [String] This layout‘s identifier, starting and ending with a
  slash
raw_content  [R]  @return [String] The raw content of this layout

Public Class methods

Creates a new layout.

@param [String] raw_content The raw content of this layout.

@param [Hash] attributes A hash containing this layout‘s attributes.

@param [String] identifier This layout‘s identifier.

@param [Time, Hash] params Extra parameters. For backwards

  compatibility, this can be a Time instance indicating the time when
  this layout was last modified (mtime).

@option params [Time, nil] :mtime (nil) The time when this layout was

  last modified. Deprecated; pass the modification time as the `:mtime`
  attribute instead.

Public Instance methods

Requests the attribute with the given key.

@param [Symbol] key The name of the attribute to fetch.

@return [Object] The value of the requested attribute.

@return [String] The checksum for this object. If its contents change,

  the checksum will change as well.

Prevents all further modifications to the layout.

@return [void]

@deprecated Access the modification time using `layout[:mtime]` instead.

Returns an object that can be used for uniquely identifying objects.

@api private

@return [Object] An unique reference to this object

Returns the type of this object. Will always return `:layout`, because this is a layout. For items, this method returns `:item`.

@api private

@return [Symbol] :layout

[Validate]