Class: Writecast::Year_index

Inherits:
Object
  • Object
show all
Defined in:
lib/writecast/models.rb

Instance Method Summary collapse

Constructor Details

#initialize(year, month_hash) ⇒ Year_index

Returns a new instance of Year_index.



149
150
151
152
# File 'lib/writecast/models.rb', line 149

def initialize(year, month_hash)
    @year = year
    @month_hash = month_hash
end

Instance Method Details

#to_html(pages) ⇒ Object



154
155
156
157
158
159
160
161
# File 'lib/writecast/models.rb', line 154

def to_html(pages)
    title_tag = SITE_TITLE + SEPARATOR + ("#{@year} Archives")
    # :doc is only passed here for the menu selector.
    # There's definitely a better way to do this.
    Year_index_view.new(:doc => self, :year => @year, :months_hash => @month_hash,
                        :pages => pages, :title_tag => title_tag
                       ).to_html(:prettyprint => PRETTY_HTML)
end