Class: PolyrexObjects::Month

Inherits:
Object
  • Object
show all
Defined in:
lib/polyrex-calendar.rb

Instance Method Summary collapse

Instance Method Details

#to_webpageObject



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/polyrex-calendar.rb', line 46

def to_webpage()
  
  month_xsl = fetch_file self.xslt
  month_layout_css = fetch_file self.css_layout
  month_css = fetch_file self.css_style
        
  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}
end

#wk(n) ⇒ Object



42
43
44
# File 'lib/polyrex-calendar.rb', line 42

def wk(n)
  self.records[n-1]        
end