Sha256: ab89f4e63fe4a50fb1d74bd93135a5c778468c57584676a883c9c1a57de705f7

Contents?: true

Size: 577 Bytes

Versions: 42

Compression:

Stored size: 577 Bytes

Contents

#!/usr/bin/env ruby
## Need this so we can require the library from the samples directory
$:.unshift(File.dirname(__FILE__) + '/../lib')

require 'icalendar'
require 'date'
  
# Open a file or string to parse
cal_file = File.open("../test/life.ics")

# Parser returns an array of calendars because a single file
# can have multiple calendar objects.
cals = Icalendar::parse(cal_file)
cal = cals.first

# Now you can access the cal object in just the same way I created it
event = cal.events.first

puts "start date-time: " + event.dtstart.to_s
puts "summary: " + event.summary

Version data entries

42 entries across 42 versions & 4 rubygems

Version Path
icalendar-1.4.2 examples/parse_cal.rb
icalendar-1.4.1 examples/parse_cal.rb
icalendar-1.4.0 examples/parse_cal.rb
icalendar-1.3.0 examples/parse_cal.rb
icalendar-1.2.4 examples/parse_cal.rb
icalendar-1.2.3 examples/parse_cal.rb
icalendar-1.2.2 examples/parse_cal.rb
icalendar-1.2.1 examples/parse_cal.rb
icalendar-1.2.0 examples/parse_cal.rb
icalendar-1.2 examples/parse_cal.rb
icalendar-1.1.6 examples/parse_cal.rb
icalendar-1.1.5 examples/parse_cal.rb
icalendar-1.1.4 examples/parse_cal.rb
icalendar-1.1.3 examples/parse_cal.rb
icalendar-1.1.2 examples/parse_cal.rb
icalendar-1.1.1 examples/parse_cal.rb
icalendar-0.98 examples/parse_cal.rb
icalendar-1.1.0 examples/parse_cal.rb
icalendar-0.97 examples/parse_cal.rb
icalendar-1.0.2 examples/parse_cal.rb