Module: LIBRARY

Included in:
PlannerTemplate
Defined in:
lib/planner_template.rb

Instance Method Summary collapse

Instance Method Details

#fetch_file(filename) ⇒ Object



15
16
17
18
19
# File 'lib/planner_template.rb', line 15

def fetch_file(filename)

  filepath = fetch_filepath filename
  read filepath
end

#fetch_filepath(filename) ⇒ Object



9
10
11
12
13
# File 'lib/planner_template.rb', line 9

def fetch_filepath(filename)

  lib = File.dirname(__FILE__)
  File.join(lib, '..', 'template', filename)
end

#generate_webpage(xml, xsl) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/planner_template.rb', line 22

def generate_webpage(xml, xsl)
  
  # transform the xml to html
  doc = Nokogiri::XML(xml)
  xslt  = Nokogiri::XSLT(xsl)
  xslt.transform(doc).to_s   
end

#read(s) ⇒ Object



30
31
32
# File 'lib/planner_template.rb', line 30

def read(s)
  RXFHelper.read(s).first
end