class Snuffle::Formatters::HtmlIndex
Attributes
start_path[RW]
summaries[RW]
Public Class Methods
new(summaries, start_path)
click to toggle source
# File lib/snuffle/formatters/html_index.rb, line 10 def initialize(summaries, start_path) self.summaries = summaries.sort{|a,b| a.cohorts.count <=> b.cohorts.count}.reverse self.start_path = start_path end
Public Instance Methods
content()
click to toggle source
# File lib/snuffle/formatters/html_index.rb, line 19 def content Haml::Engine.new(output_template).render( Object.new, { summaries: self.summaries, start_path: self.start_path, date: Time.now.strftime("%Y/%m/%d"), time: Time.now.strftime("%l:%M %P") } ) end
filename()
click to toggle source
# File lib/snuffle/formatters/html_index.rb, line 30 def filename "index.htm" end
header()
click to toggle source
# File lib/snuffle/formatters/html_index.rb, line 15 def header ["File", "Class", "Object Candidates"].map{|col| "<th>#{col.titleize}</th>"}.join("\r\n") end
output_template()
click to toggle source
# File lib/snuffle/formatters/html_index.rb, line 34 def output_template File.read(File.dirname(__FILE__) + "/templates/index.html.haml") end