If you’re looking for an alternative approach, I built this Add To Calendar Ruby Gem[0] which generates URLs for all the common Calendar platforms. There’s also this reference repo[1] which helps explains how to build your own and lists some other libraries in various languages.
Thank you! Yeah, the ics / iCalendar part of it has a spec[0] and is reasonably easy to deal with. But Google, Yahoo and Outlook Web/Office 365 all have their own take on URL construction which can be painful!