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?
55 56 |
# File 'lib/vpim/repo.rb', line 55 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()
64 65 |
# File 'lib/vpim/repo.rb', line 64 def each(klass=nil, &block) #:yield: component end |
#encode ⇒ Object
Encode into iCalendar format.
59 60 |
# File 'lib/vpim/repo.rb', line 59 def encode end |
#events(&block) ⇒ Object
Enumerate the events in the calendar.
68 69 70 |
# File 'lib/vpim/repo.rb', line 68 def events(&block) #:yield: Vevent each(Vpim::Icalendar::Vevent, &block) end |
#file_each(file, klass, &block) ⇒ Object
:nodoc:
80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/vpim/repo.rb', line 80 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.
49 50 |
# File 'lib/vpim/repo.rb', line 49 def name end |