class PolyrexObjects::Month

Public Instance Methods

to_webpage() click to toggle source
# File lib/polyrex-calendar.rb, line 29
def to_webpage()
  
  month_xsl = fetch_file self.xslt
  month_layout_css = fetch_file self.css_layout
  month_css = fetch_file self.css_style
  month_print_css = fetch_file self.css_print
        
  File.write 'lmonth.xsl', month_xsl
  doc = self.to_doc
  
  xslt_filename = File.basename self.xslt
  
  doc.instructions << [
    'xml-stylesheet',
      "title='XSL_formatting' type='text/xsl' href='lmonth.xsl'"]
  
  # add a css selector for the current day
  highlight_today()     
  
  
  File.write 'month.xml', doc.xml(pretty: true)
  
  html = generate_webpage doc.xml, month_xsl
  
  {
    self.title.downcase[0..2] + '_calendar.html' => html,
    self.css_layout => month_layout_css, self.css_style => month_css, 
    self.css_print => month_print_css
  }
end
wk(n) click to toggle source
# File lib/polyrex-calendar.rb, line 25
def wk(n)
  self.records[n-1]        
end