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.



60
61
62
63
64
65
66
67
68
# File 'lib/polyrex_calendarbase.rb', line 60

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

Instance Method Details

#save(filename = @filename) ⇒ Object



70
71
72
# File 'lib/polyrex_calendarbase.rb', line 70

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

#to_xml(options = {}) ⇒ Object



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

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