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.

Instance Method Summary collapse

Instance Method Details

#displayedObject

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

#encodeObject

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

#nameObject

The calendar name.



48
49
# File 'lib/vpim/repo.rb', line 48

def name
end

#todos(&block) ⇒ Object

Enumerate the todos in the calendar.



72
73
74
# File 'lib/vpim/repo.rb', line 72

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