Class: RiCal::RequiredTimezones

Inherits:
Object
  • Object
show all
Defined in:
lib/ri_cal/required_timezones.rb

Overview

RequireTimezones collects the timezones used by a given calendar component or set of calendar components For each timezone we collect it’s id, and the earliest and latest times which reference the zone

Defined Under Namespace

Classes: RequiredTimezone

Instance Method Summary collapse

Instance Method Details

#add_datetime(date_time, tzid) ⇒ Object



49
50
51
# File 'lib/ri_cal/required_timezones.rb', line 49

def add_datetime(date_time, tzid)
  (required_timezones[tzid] ||= RequiredTimezone.new(tzid)).add_datetime(date_time)
end

#export_to(export_stream) ⇒ Object



42
43
44
45
46
47
# File 'lib/ri_cal/required_timezones.rb', line 42

def export_to(export_stream)
  required_zones.each do |z|
    tzinfo_timezone =z.timezone
    tzinfo_timezone.export_local_to(export_stream, z.first_time, z.last_time)
  end
end

#required_timezonesObject



34
35
36
# File 'lib/ri_cal/required_timezones.rb', line 34

def required_timezones
  @required_zones ||= {}
end

#required_zonesObject



38
39
40
# File 'lib/ri_cal/required_timezones.rb', line 38

def required_zones
  required_timezones.values
end