Class: Vpim::Repo::Calendar
- Inherits:
-
Object
- Object
- Vpim::Repo::Calendar
- Includes:
- Enumerable
- Defined in:
- lib/vpim/repo.rb
Overview
A calendar abstraction. It models a calendar in a calendar repository that may not be an iCalendar.
It has methods that behave identically to Icalendar, but it also has methods like name and displayed that are not present in an iCalendar.
Direct Known Subclasses
Instance Method Summary collapse
-
#displayed ⇒ Object
Whether a calendar should be displayed.
-
#each(klass = nil, &block) ⇒ Object
Enumerate the components in the calendar, both todos and events, or the specified klass.
-
#encode ⇒ Object
Encode into iCalendar format.
-
#events(&block) ⇒ Object
Enumerate the events in the calendar.
-
#file_each(file, klass, &block) ⇒ Object
:nodoc:.
-
#name ⇒ Object
The calendar name.
-
#todos(&block) ⇒ Object
Enumerate the todos in the calendar.
Instance Method Details
#displayed ⇒ Object
Whether a calendar should be displayed.
TODO - should be #displayed?
54 55 |
# File 'lib/vpim/repo.rb', line 54 def displayed end |
#each(klass = nil, &block) ⇒ Object
Enumerate the components in the calendar, both todos and events, or the specified klass. Like Icalendar#each()
63 64 |
# File 'lib/vpim/repo.rb', line 63 def each(klass=nil, &block) #:yield: component end |
#encode ⇒ Object
Encode into iCalendar format.
58 59 |
# File 'lib/vpim/repo.rb', line 58 def encode end |
#events(&block) ⇒ Object
Enumerate the events in the calendar.
67 68 69 |
# File 'lib/vpim/repo.rb', line 67 def events(&block) #:yield: Vevent each(Vpim::Icalendar::Vevent, &block) end |
#file_each(file, klass, &block) ⇒ Object
:nodoc:
79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/vpim/repo.rb', line 79 def file_each(file, klass, &block) #:nodoc: unless iterator? return Enumerable::Enumerator.new(self, :each, klass) end cals = open(file) do |io| Vpim::Icalendar.decode(io) end cals.each do |cal| cal.each(klass, &block) end self end |
#name ⇒ Object
The calendar name.
48 49 |
# File 'lib/vpim/repo.rb', line 48 def name end |