Class: Calendar
- Inherits:
-
Object
- Object
- Calendar
- Defined in:
- lib/calendars.rb
Overview
Remembers calendar meta data from xml configuration.
Instance Attribute Summary collapse
-
#display ⇒ Object
readonly
Returns the value of attribute display.
-
#forward ⇒ Object
readonly
Returns the value of attribute forward.
Instance Method Summary collapse
-
#initialize(calendar) ⇒ Calendar
constructor
A new instance of Calendar.
-
#match?(title) ⇒ Boolean
Checks if title match this calendar.
Constructor Details
#initialize(calendar) ⇒ Calendar
Returns a new instance of Calendar.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/calendars.rb', line 3 def initialize(calendar) @regexp = false; @display = true; @forward = 0; if calendar["forward"] == "false" @display = false else @forward = calendar["forward"].to_i end @regexp = true if calendar["regexp"] == "true" @title = calendar["content"] if $DEBUG puts calendar.inspect puts "D: #{@display}, RE: #{@regexp}\n*******" end end |
Instance Attribute Details
#display ⇒ Object (readonly)
Returns the value of attribute display.
29 30 31 |
# File 'lib/calendars.rb', line 29 def display @display end |
#forward ⇒ Object (readonly)
Returns the value of attribute forward.
29 30 31 |
# File 'lib/calendars.rb', line 29 def forward @forward end |
Instance Method Details
#match?(title) ⇒ Boolean
Checks if title match this calendar.
21 22 23 24 25 26 27 |
# File 'lib/calendars.rb', line 21 def match?(title) if @regexp return title =~ /#{@title}/ else return title == @title end end |