Class: CalInvite::Providers::Office365

Inherits:
BaseProvider show all
Defined in:
lib/cal_invite/providers/office365.rb

Overview

Microsoft Office 365 provider for generating calendar event URLs. This provider generates URLs that open the Office 365 web calendar with a pre-filled event creation form. Supports both all-day and time-specific events with proper timezone handling.

Examples:

Creating a regular event URL

event = CalInvite::Event.new(
  title: "Team Meeting",
  start_time: Time.now,
  end_time: Time.now + 3600,
  description: "Weekly team sync"
)
office365 = CalInvite::Providers::Office365.new(event)
url = office365.generate

Creating an all-day event URL with attendees

event = CalInvite::Event.new(
  title: "Company Off-Site",
  all_day: true,
  start_time: Date.today,
  end_time: Date.today + 1,
  attendees: ["[email protected]", "[email protected]"],
  show_attendees: true
)
url = CalInvite::Providers::Office365.new(event).generate

Instance Attribute Summary

Attributes inherited from BaseProvider

#event

Instance Method Summary collapse

Methods inherited from BaseProvider

#initialize

Constructor Details

This class inherits a constructor from BaseProvider

Instance Method Details

#generateString

Generates an Office 365 calendar URL for the event. Automatically handles both all-day and time-specific events.

Returns:

  • (String)

    The Office 365 calendar URL

Raises:

  • (ArgumentError)

    If required time fields are missing for non-all-day events



37
38
39
40
41
42
43
# File 'lib/cal_invite/providers/office365.rb', line 37

def generate
  if event.all_day
    generate_all_day_event
  else
    generate_single_event
  end
end