class OakTree::Template::PostArchive

Attributes

month[RW]
next_archive[RW]

the next most recent archive

posts[RW]
previous_archive[RW]

the next oldest archive

year[RW]

Public Class Methods

new(year=1, month=1, posts=[], spec, blog) { |self| ... } click to toggle source
# File lib/oaktree/template/post_archive.rb, line 20
def initialize year=1, month=1, posts=[], spec, blog
  @year = year
  @month = month
  @posts = posts
  @spec = spec
  @blog = blog
  @datetime = DateTime.new(year, month, 1)
  formatted_date = @datetime.strftime(@spec.date_path_format)
  @permalink = "#{@spec.base_url}#{@spec.post_path}#{formatted_date}"

  yield self if block_given?
end

Public Instance Methods

date() click to toggle source
# File lib/oaktree/template/post_archive.rb, line 33
def date
  proc_for_datetime(@datetime)
end
datetime() click to toggle source
# File lib/oaktree/template/post_archive.rb, line 37
def datetime
  @datetime
end
open?() click to toggle source
# File lib/oaktree/template/post_archive.rb, line 45
def open?
  self == @blog.archive
end