Sha256: a2807288b40f5d2f388be44438acea53416313be66214edf9b33724923d2d58e

Contents?: true

Size: 692 Bytes

Versions: 6

Compression:

Stored size: 692 Bytes

Contents

# frozen_string_literal: true

# @api private
# @since 0.1.0
module Sidekiq::Portal::Timeline::Builder
  class << self
    # @param initial_time [Time]
    # @param cron_pattern [String, NilClass]
    # @param every_pattern [String, NilClass]
    # @param timezone [String]
    # @return [Sidekiq::Portal::Timeline]
    #
    # @api private
    # @since 0.1.0
    def build(initial_time, cron_pattern, every_pattern, timezone)
      time_plan = Fugit.parse(cron_pattern) if cron_pattern
      time_plan = Fugit.parse(every_pattern) if every_pattern
      timezoner = ActiveSupport::TimeZone[timezone]

      Sidekiq::Portal::Timeline.new(initial_time, timezoner, time_plan)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sidekiq_portal-0.3.2 lib/portal/timeline/builder.rb
sidekiq_portal-0.3.1 lib/portal/timeline/builder.rb
sidekiq_portal-0.3.0 lib/portal/timeline/builder.rb
sidekiq_portal-0.2.0 lib/portal/timeline/builder.rb
sidekiq_portal-0.1.1 lib/portal/timeline/builder.rb
sidekiq_portal-0.1.0 lib/portal/timeline/builder.rb