Class: Calendar

Inherits:
Polyrex
  • Object
show all
Includes:
LIBRARY
Defined in:
lib/polyrex_calendarbase.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from LIBRARY

#fetch_file, #generate_webpage, #read

Instance Attribute Details

#css_layoutObject

Returns the value of attribute css_layout.



74
75
76
# File 'lib/polyrex_calendarbase.rb', line 74

def css_layout
  @css_layout
end

#css_styleObject

Returns the value of attribute css_style.



74
75
76
# File 'lib/polyrex_calendarbase.rb', line 74

def css_style
  @css_style
end

#filenameObject

Returns the value of attribute filename.



74
75
76
# File 'lib/polyrex_calendarbase.rb', line 74

def filename
  @filename
end

#xsltObject

Returns the value of attribute xslt.



74
75
76
# File 'lib/polyrex_calendarbase.rb', line 74

def xslt
  @xslt
end

Instance Method Details

#inspectObject



78
79
80
# File 'lib/polyrex_calendarbase.rb', line 78

def inspect()
  "#<Calendar:%s" % __id__
end

#month(n) ⇒ Object



82
83
84
# File 'lib/polyrex_calendarbase.rb', line 82

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

#to_webpageObject



86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/polyrex_calendarbase.rb', line 86

def to_webpage()

  year_xsl        = self.xslt ? read(self.xslt) : fetch_file(self.xslt)
  year_layout_css = fetch_file self.css_layout
  year_css        = fetch_file self.css_style
  File.open('self.xml','w'){|f| f.write (self.to_xml pretty: true)}
  File.open(self.xslt,'w'){|f| f.write year_xsl }
  #html = Rexslt.new(month_xsl, self.to_xml).to_xml

  html = generate_webpage self.to_xml, year_xsl
  {self.filename => html, 
    self.css_layout => year_layout_css, self.css_style => year_css}

end