Class: CalendarObjects::Month

Inherits:
PolyrexObjects::Month show all
Defined in:
lib/polyrex_calendarbase.rb

Instance Attribute Summary

Attributes inherited from PolyrexObjects::Month

#css_layout, #css_style, #xslt

Instance Method Summary collapse

Methods inherited from PolyrexObjects::Month

#d, #find_today, #highlight_today, #inspect

Methods included from LIBRARY2

#fetch_file, #fetch_filepath, #generate_webpage, #read

Constructor Details

#initialize(filename) ⇒ Month

Returns a new instance of Month.



119
120
121
122
123
124
125
126
127
# File 'lib/polyrex_calendarbase.rb', line 119

def initialize(filename)
  
  @filename = filename
  
  buffer = File.read filename
  @doc = Rexle.new buffer    
  @node = @doc.root
  
end

Instance Method Details

#save(filename = @filename) ⇒ Object



129
130
131
# File 'lib/polyrex_calendarbase.rb', line 129

def save(filename=@filename)    
  File.write filename, @doc.xml(pretty: true)
end

#to_xml(options = {}) ⇒ Object



133
134
135
# File 'lib/polyrex_calendarbase.rb', line 133

def to_xml(options={})
  @doc.xml(options)
end