Class: Nanoc3::Layout

A Nanoc3::Layout represents a layout in a nanoc site. It has content, attributes (for determining which filter to use for laying out an item), an identifier (because layouts are organised hierarchically), and a modification time (to speed up compilation).

Attributes

Instance Attributes

attributes [R] public

A hash containing this layout’s attributes.

identifier [RW] public

This layout’s identifier, starting and ending with a slash.

mtime [R] public

The time when this layout was last modified.

raw_content [R] public

The raw content of this layout.

site [RW] public

The Nanoc3::Site this layout belongs to.

Constructor Summary

public initialize(raw_content, attributes, identifier, mtime = nil)

Creates a new layout.

content:The raw content of this layout.
attributes:A hash containing this layout’s attributes.
identifier:This layout’s identifier.
mtime:The time when this layout was last modified.
[View source]


35
36
37
38
39
40
# File 'lib/nanoc3/base/layout.rb', line 35

def initialize(raw_content, attributes, identifier, mtime=nil)
  @raw_content  = raw_content
  @attributes   = attributes.symbolize_keys
  @identifier   = identifier.cleaned_identifier
  @mtime        = mtime
end

Public Visibility

Public Instance Method Summary

#[](key)

Requests the attribute with the given key.

#inspect

Public Instance Method Details

[]

public [](key)

Requests the attribute with the given key.

[View source]


43
44
45
# File 'lib/nanoc3/base/layout.rb', line 43

def [](key)
  @attributes[key]
end

inspect

public inspect
[View source]


47
48
49
# File 'lib/nanoc3/base/layout.rb', line 47

def inspect
  "<#{self.class}:0x#{self.object_id.to_s(16)} identifier=#{self.identifier}>"
end
Generated on Sunday, August 09 2009 at 01:43:09 PM by YARD 0.2.3.2 (ruby-1.8.7).