class Livecal::CalendarSource
Attributes
source[R]
Public Class Methods
from_file(path)
click to toggle source
# File lib/livecal/calendar_source.rb, line 13 def self.from_file(path) from_string(File.read(path)) end
from_string(contents)
click to toggle source
# File lib/livecal/calendar_source.rb, line 17 def self.from_string(contents) Icalendar::Calendar.parse(contents).collect { |source| new(source) } end
from_url(url)
click to toggle source
# File lib/livecal/calendar_source.rb, line 9 def self.from_url(url) from_string(Net::HTTP.get(URI(url))) end
new(source)
click to toggle source
# File lib/livecal/calendar_source.rb, line 21 def initialize(source) @source = source end
Public Instance Methods
recurring_changes()
click to toggle source
# File lib/livecal/calendar_source.rb, line 25 def recurring_changes events.select { |event| event.rrule.empty? && event.recurrence_id } end
recurring_events()
click to toggle source
# File lib/livecal/calendar_source.rb, line 29 def recurring_events events.select { |event| event.rrule.any? } end
standalone_events()
click to toggle source
# File lib/livecal/calendar_source.rb, line 33 def standalone_events events.select { |event| event.rrule.empty? && event.recurrence_id.nil? } end
Private Instance Methods
events()
click to toggle source
# File lib/livecal/calendar_source.rb, line 41 def events source.events end