Class: Montrose::ICal

Inherits:
Object
  • Object
show all
Defined in:
lib/montrose/ical.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ical) ⇒ ICal

Returns a new instance of ICal.



11
12
13
# File 'lib/montrose/ical.rb', line 11

def initialize(ical)
  @ical = ical
end

Class Method Details

.parse(ical) ⇒ Object

DTSTART;TZID=US-Eastern:19970902T090000 RRULE:FREQ=DAILY;INTERVAL=2



7
8
9
# File 'lib/montrose/ical.rb', line 7

def self.parse(ical)
  new(ical).parse
end

Instance Method Details

#parseObject



15
16
17
18
19
20
21
# File 'lib/montrose/ical.rb', line 15

def parse
  time_zone = extract_time_zone(@ical)

  Time.use_zone(time_zone) do
    Hash[*parse_properties(@ical)]
  end
end