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, #fetch_filepath, #generate_webpage, #read

Instance Attribute Details

#css_layoutObject

Returns the value of attribute css_layout.



84
85
86
# File 'lib/polyrex_calendarbase.rb', line 84

def css_layout
  @css_layout
end

#css_styleObject

Returns the value of attribute css_style.



84
85
86
# File 'lib/polyrex_calendarbase.rb', line 84

def css_style
  @css_style
end

#filenameObject

Returns the value of attribute filename.



84
85
86
# File 'lib/polyrex_calendarbase.rb', line 84

def filename
  @filename
end

#xsltObject

Returns the value of attribute xslt.



84
85
86
# File 'lib/polyrex_calendarbase.rb', line 84

def xslt
  @xslt
end

Instance Method Details

#inspectObject



88
89
90
# File 'lib/polyrex_calendarbase.rb', line 88

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

#month(n) ⇒ Object



92
93
94
# File 'lib/polyrex_calendarbase.rb', line 92

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

#to_webpageObject



96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/polyrex_calendarbase.rb', line 96

def to_webpage()

  year_xsl        = read(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(File.basename(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