Sha256: 3f77c1b3bc60081df2f492c6a6ee38b3c374f30c795907785acbbce4cb6f37a3
Contents?: true
Size: 592 Bytes
Versions: 13
Compression:
Stored size: 592 Bytes
Contents
# encoding: utf-8 # frozen_string_literal: true require "api_cache" require "active_support" require "icalendar" module Jekyll class IcalTag class CalendarParser def initialize(url) @url = URI.unescape(url) end def events @events ||= begin Icalendar::Event.parse(ics_feed) .sort { |e1, e2| e1.dtstart <=> e2.dtstart } .map { |e| Jekyll::IcalTag::Event.new(e) } end end private def ics_feed @ics_feed ||= APICache.get(@url) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems