Class: Nanoc2::Defaults

Inherits:
Object
  • Object
show all
Defined in:
lib/nanoc2/base/defaults.rb

Overview

Nanoc2::Defaults represent the default attributes for a given set of objects in the site. It is basically a hash with an optional modification time.

Direct Known Subclasses

AssetDefaults, PageDefaults

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes, mtime = nil) ⇒ Defaults

Creates a new set of defaults.

attributes

The hash containing the metadata that individual objects will override.

mtime

The time when the defaults were last modified (optional).



23
24
25
26
# File 'lib/nanoc2/base/defaults.rb', line 23

def initialize(attributes, mtime=nil)
  @attributes = attributes.clean
  @mtime      = mtime
end

Instance Attribute Details

#attributesObject (readonly)

A hash containing the default attributes.



12
13
14
# File 'lib/nanoc2/base/defaults.rb', line 12

def attributes
  @attributes
end

#mtimeObject (readonly)

The time when this set of defaults was last modified.



15
16
17
# File 'lib/nanoc2/base/defaults.rb', line 15

def mtime
  @mtime
end

#siteObject

Th site where this set of defaults belongs to.



9
10
11
# File 'lib/nanoc2/base/defaults.rb', line 9

def site
  @site
end