Class: Blogit::Archive::List

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#archiveablesObject

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

#yearsObject

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_pathObject

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