Class: Blogit::Archive::List

Inherits:
Object
  • Object
show all
Defined in:
lib/blogit/archive/list.rb

Overview

The main class to be accessed when creating a HTML post archive.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (List) initialize(archiveables)

Create a new List object

Parameters:

  • 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

- (Object) archiveables

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

- (Object) years

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

- (Object) to_partial_path

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