Module: LIBRARY2

Included in:
Calendar, PolyrexCalendarBase, PolyrexObjects::Month
Defined in:
lib/polyrex_calendarbase.rb

Instance Method Summary collapse

Instance Method Details

#fetch_file(filename) ⇒ Object



23
24
25
26
27
# File 'lib/polyrex_calendarbase.rb', line 23

def fetch_file(filename)

  filepath = fetch_filepath filename
  read filepath
end

#fetch_filepath(filename) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/polyrex_calendarbase.rb', line 15

def fetch_filepath(filename)

  #lib = File.dirname(__FILE__)
  #File.read filename      
  lib = 'http://rorbuilder.info/r/ruby/polyrex-calendar'
  File.join(lib, filename)
end

#generate_webpage(xml, xsl) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/polyrex_calendarbase.rb', line 30

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



38
39
40
# File 'lib/polyrex_calendarbase.rb', line 38

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