Class: Calendar

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from LIBRARY2

#fetch_file, #fetch_filepath, #generate_webpage, #read

Instance Attribute Details

#css_layoutObject

Returns the value of attribute css_layout.



144
145
146
# File 'lib/polyrex_calendarbase.rb', line 144

def css_layout
  @css_layout
end

#css_styleObject

Returns the value of attribute css_style.



144
145
146
# File 'lib/polyrex_calendarbase.rb', line 144

def css_style
  @css_style
end

#filenameObject

Returns the value of attribute filename.



144
145
146
# File 'lib/polyrex_calendarbase.rb', line 144

def filename
  @filename
end

#xsltObject

Returns the value of attribute xslt.



144
145
146
# File 'lib/polyrex_calendarbase.rb', line 144

def xslt
  @xslt
end

Instance Method Details

#inspectObject



148
149
150
# File 'lib/polyrex_calendarbase.rb', line 148

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

#month(n) ⇒ Object



152
153
154
# File 'lib/polyrex_calendarbase.rb', line 152

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

#to_webpageObject



156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/polyrex_calendarbase.rb', line 156

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