Class: Nanoc2::Defaults
- Inherits:
-
Object
- Object
- Nanoc2::Defaults
- 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
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
A hash containing the default attributes.
-
#mtime ⇒ Object
readonly
The time when this set of defaults was last modified.
-
#site ⇒ Object
Th site where this set of defaults belongs to.
Instance Method Summary collapse
-
#initialize(attributes, mtime = nil) ⇒ Defaults
constructor
Creates a new set of defaults.
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
#attributes ⇒ Object (readonly)
A hash containing the default attributes.
12 13 14 |
# File 'lib/nanoc2/base/defaults.rb', line 12 def attributes @attributes end |
#mtime ⇒ Object (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 |
#site ⇒ Object
Th site where this set of defaults belongs to.
9 10 11 |
# File 'lib/nanoc2/base/defaults.rb', line 9 def site @site end |