Sha256: 8a0230dc2aec37384ed22df07e1569750d4d258b57330d77adc0f06b53a98d0b

Contents?: true

Size: 894 Bytes

Versions: 2

Compression:

Stored size: 894 Bytes

Contents

# frozen_string_literal

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

2 entries across 2 versions & 2 rubygems

Version Path
sentry-ruby-5.12.0 lib/sentry/cron/monitor_schedule.rb
sentry-ruby-core-5.12.0 lib/sentry/cron/monitor_schedule.rb