Sha256: c16a98dc783aef50c18d9f1ea6993473f85374981f0b07b6645badfebb558488

Contents?: true

Size: 1.03 KB

Versions: 8

Compression:

Stored size: 1.03 KB

Contents

# encoding: utf-8
# frozen_string_literal: true

module Jekyll
  class IcalTag
    class CalendarFeedCoordinator
      def initialize(url:, only: nil, reverse: nil, before_date: nil, after_date: nil, limit: nil)
        @url = url
        @only = only
        @reverse = reverse
        @before_date = before_date
        @after_date = after_date
        @limit = limit
      end

      def events
        parser.events
      end

      private

      attr_reader :url, :only, :reverse, :before_date, :after_date, :limit

      def raw_ical
        @raw_ical ||= CalendarFetcher.new(url).fetch
      end

      def parser
        @parser ||= begin
          parser = CalendarParser.new(raw_ical)
          parser = CalendarLimiter.new(parser, only: only)
          parser = CalendarLimiter.new(parser, reverse: reverse)
          parser = CalendarLimiter.new(parser, before_date: before_date)
          parser = CalendarLimiter.new(parser, after_date: after_date)
          CalendarLimiter.new(parser, limit: limit)
        end
      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_feed_coordinator.rb
jekyll-ical-tag-1.5 lib/jekyll-ical-tag/calendar_feed_coordinator.rb
jekyll-ical-tag-1.4.0 _site/lib/jekyll-ical-tag/calendar_feed_coordinator.rb
jekyll-ical-tag-1.4.0 lib/jekyll-ical-tag/calendar_feed_coordinator.rb
jekyll-ical-tag-1.3.3 lib/jekyll-ical-tag/calendar_feed_coordinator.rb
jekyll-ical-tag-1.3.2 lib/jekyll-ical-tag/calendar_feed_coordinator.rb
jekyll-ical-tag-1.3.1 lib/jekyll-ical-tag/calendar_feed_coordinator.rb
jekyll-ical-tag-1.3 lib/jekyll-ical-tag/calendar_feed_coordinator.rb