Represents a layout in a nanoc site. It has content, attributes, an identifier and a modification time (to speed up compilation).
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, nil] params_or_mtime Extra parameters for the layout, or the time when this layout was last modified (deprecated).
@option params_or_mtime [Time, nil] :mtime (nil) The time when this layout was last modified
# File lib/nanoc3/base/layout.rb, line 37 def initialize(raw_content, attributes, identifier, params_or_mtime=nil) # Get params and mtime # TODO [in nanoc 4.0] clean this up if params_or_mtime.nil? || params_or_mtime.is_a?(Time) params = {} @mtime = params_or_mtime elsif params_or_mtime.is_a?(Hash) params = params_or_mtime @mtime = params[:mtime] end @raw_content = raw_content @attributes = attributes.symbolize_keys @identifier = identifier.cleaned_identifier end
Generated with the Darkfish Rdoc Generator 2.