Class: Vpim::Repo::Calendar

Inherits:
Object
  • Object
show all
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

Apple3::Calendar, Directory::Calendar

Instance Method Summary collapse

Instance Method Details

#displayedObject

Whether a calendar should be displayed.

TODO - should be #displayed?



52
53
# File 'lib/vpim/repo.rb', line 52

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()



61
62
# File 'lib/vpim/repo.rb', line 61

def each(klass=nil, &block) #:yield: component
end

#encodeObject

Encode into iCalendar format.



56
57
# File 'lib/vpim/repo.rb', line 56

def encode
end

#events(&block) ⇒ Object

Enumerate the events in the calendar.



65
66
67
# File 'lib/vpim/repo.rb', line 65

def events(&block) #:yield: Vevent
  each(Vpim::Icalendar::Vevent, &block)
end

#file_each(file, klass, &block) ⇒ Object

:nodoc:



77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/vpim/repo.rb', line 77

def file_each(file, klass, &block) #:nodoc:
  unless iterator?
    return Enumerable::Enumerator.new(self, :each, klass)
  end

  cals = Vpim::Icalendar.decode(File.open(file))

  cals.each do |cal|
    cal.each(klass, &block)
  end
  self
end

#nameObject

The calendar name.



46
47
# File 'lib/vpim/repo.rb', line 46

def name
end

#todos(&block) ⇒ Object

Enumerate the todos in the calendar.



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

def todos(&block) #:yield: Vtodo
  each(Vpim::Icalendar::Vtodo, &block)
end