Class: Fonecal::Calendar
- Inherits:
-
Object
- Object
- Fonecal::Calendar
- Defined in:
- lib/fonecal/calendar.rb
Instance Attribute Summary collapse
-
#calendar ⇒ Object
Returns the value of attribute calendar.
Instance Method Summary collapse
-
#initialize(gps) ⇒ Calendar
constructor
A new instance of Calendar.
Constructor Details
#initialize(gps) ⇒ Calendar
Returns a new instance of Calendar.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/fonecal/calendar.rb', line 5 def initialize(gps) @calendar = File.new('fonecal.ics', 'w') @calendar.puts "BEGIN:VCALENDAR" @calendar.puts "VERSION:2.0" @calendar.puts "PRODID:-//fonecal//NONSGML v1.0//EN" @calendar.puts "" gps.each do |gp| gp.events.each do |event| addEvent(gp, event) end end @calendar.puts "END:VCALENDAR" @calendar.close end |
Instance Attribute Details
#calendar ⇒ Object
Returns the value of attribute calendar.
3 4 5 |
# File 'lib/fonecal/calendar.rb', line 3 def calendar @calendar end |