Class: RiCal::RequiredTimezones

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

Overview

  • ©2009 Rick DeNatale, All rights reserved. Refer to the file README.txt for the license

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



51
52
53
# File 'lib/ri_cal/required_timezones.rb', line 51

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

#export_to(export_stream) ⇒ Object



44
45
46
47
48
49
# File 'lib/ri_cal/required_timezones.rb', line 44

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



36
37
38
# File 'lib/ri_cal/required_timezones.rb', line 36

def required_timezones
  @required_zones ||= {}
end

#required_zonesObject



40
41
42
# File 'lib/ri_cal/required_timezones.rb', line 40

def required_zones
  required_timezones.values
end