Class: Writecast::Month_index

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

Instance Method Summary collapse

Constructor Details

#initialize(year, month, month_posts) ⇒ Month_index

Returns a new instance of Month_index.



166
167
168
169
170
# File 'lib/writecast/models.rb', line 166

def initialize(year, month, month_posts)
    @year = year
    @month = month
    @month_posts = month_posts
end

Instance Method Details

#to_html(pages) ⇒ Object



172
173
174
175
176
177
178
# File 'lib/writecast/models.rb', line 172

def to_html(pages)
    title_tag = SITE_TITLE + SEPARATOR + @year.to_s + SEPARATOR + Date::MONTHNAMES[@month]
    Month_index_view.new(:doc => self, :year => @year, :month => @month,
                         :posts => @month_posts, :pages => pages,
                         :title_tag => title_tag
                        ).to_html(:prettyprint => PRETTY_HTML)
end