Sha256: e46d3fe7f831f62f26068c6b0a838901975c34214436fcbcb67bc401b452e3a8

Contents?: true

Size: 530 Bytes

Versions: 8

Compression:

Stored size: 530 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true

require "active_support"
require "icalendar"

module Jekyll
  class IcalTag
    class CalendarParser
      def initialize(raw_feed)
        @raw_feed = raw_feed
      end

      def events
        @events ||= parsed_feed.sort { |event1, event2| event1.dtstart <=> event2.dtstart }
                               .map { |event| Jekyll::IcalTag::Event.new(event) }
      end

      private

      def parsed_feed
        Icalendar::Event.parse(@raw_feed)
      end
    end
  end
end

Version data entries

8 entries across 7 versions & 1 rubygems

Version Path
jekyll-ical-tag-1.5.1 lib/jekyll-ical-tag/calendar_parser.rb
jekyll-ical-tag-1.5 lib/jekyll-ical-tag/calendar_parser.rb
jekyll-ical-tag-1.4.0 _site/lib/jekyll-ical-tag/calendar_parser.rb
jekyll-ical-tag-1.4.0 lib/jekyll-ical-tag/calendar_parser.rb
jekyll-ical-tag-1.3.3 lib/jekyll-ical-tag/calendar_parser.rb
jekyll-ical-tag-1.3.2 lib/jekyll-ical-tag/calendar_parser.rb
jekyll-ical-tag-1.3.1 lib/jekyll-ical-tag/calendar_parser.rb
jekyll-ical-tag-1.3 lib/jekyll-ical-tag/calendar_parser.rb