Class: PlannerTemplate
- Inherits:
-
Object
- Object
- PlannerTemplate
- Includes:
- LIBRARY
- Defined in:
- lib/planner_template.rb
Instance Method Summary collapse
-
#initialize(src, template: 'default') ⇒ PlannerTemplate
constructor
A new instance of PlannerTemplate.
- #to_html ⇒ Object
- #to_xml(options) ⇒ Object
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_html ⇒ Object
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() Rexle.new(@xml).xml() end |