Class: Vpim::Repo::Ical3::Calendar
- Inherits:
-
Object
- Object
- Vpim::Repo::Ical3::Calendar
- Defined in:
- lib/vpim/repo.rb
Instance Method Summary collapse
-
#displayed ⇒ Object
Whether a calendar should be displayed.
-
#events ⇒ Object
Array of all events defined in the calendar.
-
#initialize(dir) ⇒ Calendar
constructor
:nodoc:.
-
#name ⇒ Object
The calendar name.
-
#plist(key) ⇒ Object
:nodoc:.
-
#todos ⇒ Object
Array of all todos defined in the calendar.
Constructor Details
#initialize(dir) ⇒ Calendar
:nodoc:
44 45 46 |
# File 'lib/vpim/repo.rb', line 44 def initialize(dir) # :nodoc: @dir = dir end |
Instance Method Details
#displayed ⇒ Object
Whether a calendar should be displayed.
57 58 59 |
# File 'lib/vpim/repo.rb', line 57 def displayed 1 == plist("Checked") end |
#events ⇒ Object
Array of all events defined in the calendar.
62 63 64 65 66 |
# File 'lib/vpim/repo.rb', line 62 def events #:yield: Vevent Dir[ @dir + "/Events/*.ics" ].map do |ics| Repo.events_from_file(ics) end.flatten end |
#name ⇒ Object
The calendar name.
52 53 54 |
# File 'lib/vpim/repo.rb', line 52 def name plist "Title" end |
#plist(key) ⇒ Object
:nodoc:
47 48 49 |
# File 'lib/vpim/repo.rb', line 47 def plist(key) #:nodoc: Plist::parse_xml( @dir + "/Info.plist")[key] end |
#todos ⇒ Object
Array of all todos defined in the calendar.
69 70 71 72 73 |
# File 'lib/vpim/repo.rb', line 69 def todos #:yield: Vevent Dir[ @dir + "/Events/*.ics" ].map do |ics| Repo.todos_from_file(ics) end.flatten end |