Class: PolyrexObjects::Month

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

Instance Method Summary collapse

Instance Method Details

#to_webpageObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/polyrex-calendar.rb', line 17

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



13
14
15
# File 'lib/polyrex-calendar.rb', line 13

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