class PlannerTemplate
Public Class Methods
new(src, template: 'default')
click to toggle source
# File lib/planner_template.rb, line 26 def initialize(src, template: 'default') @xml = fetch_file src @xmldoc = Rexle.new(@xml) @template = template end
Public Instance Methods
to_html()
click to toggle source
# File lib/planner_template.rb, line 34 def to_html() xsl = fetch_file File.join(@template, 'planner.xsl') @html = generate_webpage(@xml, xsl) end
to_xml(options)
click to toggle source
# File lib/planner_template.rb, line 39 def to_xml(options) Rexle.new(@xml).xml(options) end
Protected Instance Methods
fetch_css()
click to toggle source
# File lib/planner_template.rb, line 45 def fetch_css() %w(layout.css style.css).map do |filename| fetch_file File.join(@template, filename) end end