module RiCal
-
©2009 Rick DeNatale, All rights reserved. Refer to the file README.txt for the license
The RiCal module provides the outermost namespace, along with several convenience methods for parsing and building calendars and calendar components.
Constants
- TimeWithZone
TimeWithZone will be set to ActiveSupport::TimeWithZone if the activesupport gem is loaded otherwise it will be nil
Public Class Methods
return a new ::Calendar. If a block is provided it will will be executed in the context of a builder object which can be used to initialize the properties and components of the new calendar.
# File lib/ri_cal.rb, line 110 def self.Calendar(&init_block) Component::Calendar.new(&init_block) end
return a new ::Freebusy calendar component. If a block is provided it will will be executed in the context of a builder object which can be used to initialize the properties and components of the new ::Freebusy.
# File lib/ri_cal.rb, line 124 def self.Freebusy(&init_block) Component::Freebusy.new(&init_block) end
return a new ::Journal calendar component. If a block is provided it will will be executed in the context of a builder object which can be used to initialize the properties and components of the new ::Event.
# File lib/ri_cal.rb, line 131 def self.Journal(&init_block) Component::Journal.new(&init_block) end
# File lib/ri_cal.rb, line 172 def self.RationalOffset self.ro_calls += 1 @rational_offset ||= Hash.new {|h, seconds| self.ro_misses += 1 h[seconds] = Rational(seconds, 86400)} end
return a new ::Timezone calendar component. If a block is provided it will will be executed in the context of a builder object which can be used to initialize the properties and timezone periods of the new ::Timezone.
# File lib/ri_cal.rb, line 138 def self.Timezone(&init_block) Component::Timezone.new(&init_block) end
return a new ::TimezonePeriod timezone component. If a block is provided it will will be executed in the context of a builder object which can be used to initialize the properties of the new ::TimezonePeriod.
# File lib/ri_cal.rb, line 145 def self.TimezonePeriod(&init_block) Component::TimezonePeriod.new(&init_block) end
Parse an io stream and return an array of iCalendar entities. Normally this will be an array of RiCal::Component::Calendar instances
# File lib/ri_cal.rb, line 82 def self.parse(io) Parser.new(io).parse end
Parse a string and return an array of iCalendar entities. see ::parse
# File lib/ri_cal.rb, line 88 def self.parse_string(string) parse(StringIO.new(string)) end
# File lib/ri_cal.rb, line 160 def self.ro_calls @ro_calls ||= 0 end
# File lib/ri_cal.rb, line 156 def self.ro_calls=(value) @ro_calls = value end
# File lib/ri_cal.rb, line 168 def self.ro_misses @ro_misses ||= 0 end
# File lib/ri_cal.rb, line 164 def self.ro_misses=(value) @ro_misses = value end