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?



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

#encodeObject

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

#nameObject

The calendar name.



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

def name
end

#todos(&block) ⇒ Object

Enumerate the todos in the calendar.



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

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