Class: Blogit::Archive::List
- Inherits:
-
Object
- Object
- Blogit::Archive::List
- Defined in:
- lib/blogit/archive/list.rb
Overview
Public: The main class to be accessed when creating a HTML post archive.
Instance Attribute Summary collapse
-
#archiveables ⇒ Object
Gets/Sets the list of _archiveable_ objects for this Archive List.
-
#years ⇒ Object
Gets/Sets the list of years for this archive object.
Instance Method Summary collapse
-
#initialize(archiveables) ⇒ List
constructor
Create a new List object.
-
#to_partial_path ⇒ Object
The name of the partial to load for a List object.
Constructor Details
#initialize(archiveables) ⇒ List
Create a new List object
archiveables - A collection of archiveable objects. An archiveable is any
object that responds to published_at.
18 19 20 21 22 |
# File 'lib/blogit/archive/list.rb', line 18 def initialize(archiveables) @archiveables = archiveables ensure_archiveables_are_valid @years = create_years_from_archiveables end |
Instance Attribute Details
#archiveables ⇒ Object
Gets/Sets the list of _archiveable_ objects for this Archive List.
11 12 13 |
# File 'lib/blogit/archive/list.rb', line 11 def archiveables @archiveables end |
#years ⇒ Object
Gets/Sets the list of years for this archive object.
8 9 10 |
# File 'lib/blogit/archive/list.rb', line 8 def years @years end |
Instance Method Details
#to_partial_path ⇒ Object
The name of the partial to load for a List object
Returns a String
27 28 29 |
# File 'lib/blogit/archive/list.rb', line 27 def to_partial_path self.class.name.underscore end |