Class: CalInvite::Providers::Ical
- Inherits:
-
BaseProvider
- Object
- BaseProvider
- CalInvite::Providers::Ical
- Defined in:
- lib/cal_invite/providers/ical.rb
Overview
iCalendar format provider for generating ICS (iCalendar) content. This provider generates calendar content following the iCalendar specification (RFC 5545). It supports single events, all-day events, and multi-day sessions with proper timezone handling.
Instance Attribute Summary
Attributes inherited from BaseProvider
Instance Method Summary collapse
-
#generate ⇒ String
Generates an iCalendar format string containing the event details.
Methods inherited from BaseProvider
Constructor Details
This class inherits a constructor from BaseProvider
Instance Method Details
#generate ⇒ String
Generates an iCalendar format string containing the event details. Includes proper calendar headers, timezone information (if needed), and one or more event blocks.
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/cal_invite/providers/ical.rb', line 35 def generate [ "BEGIN:VCALENDAR", "VERSION:2.0", "PRODID:-//CalInvite//Ruby//EN", "CALSCALE:GREGORIAN", "METHOD:#{method_value}", (event.calendar_name ? "X-WR-CALNAME:#{escape_text(event.calendar_name)}" : nil), generate_timezone, generate_events, "END:VCALENDAR" ].compact.join("\r\n") end |