Class: PolyrexObjects::Month

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

Direct Known Subclasses

CalendarObjects::Month

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.



62
63
64
# File 'lib/polyrex_calendarbase.rb', line 62

def css_layout
  @css_layout
end

#css_styleObject

Returns the value of attribute css_style.



62
63
64
# File 'lib/polyrex_calendarbase.rb', line 62

def css_style
  @css_style
end

#xsltObject

Returns the value of attribute xslt.



62
63
64
# File 'lib/polyrex_calendarbase.rb', line 62

def xslt
  @xslt
end

Instance Method Details

#d(n) ⇒ Object



68
69
70
# File 'lib/polyrex_calendarbase.rb', line 68

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

#find_todayObject



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

def find_today()
  sdate = Time.now.strftime("%Y-%b-%d")
  self.element "//day/summary[sdate='#{sdate}']"      
end

#highlight_todayObject



77
78
79
80
81
82
83
84
85
86
# File 'lib/polyrex_calendarbase.rb', line 77

def highlight_today()

  # remove the old highlight if any
  prev_day = self.at_css '.today'
  prev_day.attributes.delete :class if prev_day
  
  today = find_today()
  today.attributes[:class] = 'today'
  
end

#inspectObject



64
65
66
# File 'lib/polyrex_calendarbase.rb', line 64

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