Class: PlannerTemplate

Inherits:
Object
  • Object
show all
Includes:
LIBRARY
Defined in:
lib/planner_template.rb

Instance Method Summary collapse

Methods included from LIBRARY

#fetch_file, #generate_webpage

Constructor Details

#initialize(src, template: 'default') ⇒ PlannerTemplate

Returns a new instance of PlannerTemplate.



26
27
28
29
30
31
32
# File 'lib/planner_template.rb', line 26

def initialize(src, template: 'default')
  
  @xml = fetch_file src
  @xmldoc = Rexle.new(@xml)   
  @template = template 
      
end

Instance Method Details

#to_htmlObject



34
35
36
37
# 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) ⇒ Object



39
40
41
# File 'lib/planner_template.rb', line 39

def to_xml(options)
  Rexle.new(@xml).xml(options)
end