Sha256: 9404ddf982a24dfd3fe317881c81c5dad279bb967eff1274dda7c08ef31d7e2c

Contents?: true

Size: 900 Bytes

Versions: 28

Compression:

Stored size: 900 Bytes

Contents

# frozen_string_literal: true

module Sentry
  module Cron
    module MonitorSchedule
      class Crontab
        # A crontab formatted string such as "0 * * * *".
        # @return [String]
        attr_accessor :value

        def initialize(value)
          @value = value
        end

        def to_hash
          { type: :crontab, value: value }
        end
      end

      class Interval
        # The number representing duration of the interval.
        # @return [Integer]
        attr_accessor :value

        # The unit representing duration of the interval.
        # @return [Symbol]
        attr_accessor :unit

        VALID_UNITS = %i[year month week day hour minute]

        def initialize(value, unit)
          @value = value
          @unit = unit
        end

        def to_hash
          { type: :interval, value: value, unit: unit }
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
sentry-ruby-core-5.22.2 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-5.22.2 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-core-5.22.1 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-5.22.1 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-5.22.0 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-core-5.22.0 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-5.21.0 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-core-5.21.0 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-5.20.1 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-core-5.20.1 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-5.20.0 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-core-5.20.0 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-core-5.19.0 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-5.19.0 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-core-5.18.2 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-5.18.2 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-core-5.18.1 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-5.18.1 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-5.18.0 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-core-5.18.0 lib/sentry/cron/monitor_schedule.rb