Class: Sentry::Cron::MonitorSchedule::Interval
- Inherits:
-
Object
- Object
- Sentry::Cron::MonitorSchedule::Interval
- Defined in:
- lib/sentry/cron/monitor_schedule.rb
Constant Summary collapse
- VALID_UNITS =
%i[year month week day hour minute]
Instance Attribute Summary collapse
-
#unit ⇒ Symbol
The unit representing duration of the interval.
-
#value ⇒ Integer
The number representing duration of the interval.
Instance Method Summary collapse
-
#initialize(value, unit) ⇒ Interval
constructor
A new instance of Interval.
- #to_hash ⇒ Object
Constructor Details
#initialize(value, unit) ⇒ Interval
Returns a new instance of Interval.
31 32 33 34 |
# File 'lib/sentry/cron/monitor_schedule.rb', line 31 def initialize(value, unit) @value = value @unit = unit end |
Instance Attribute Details
#unit ⇒ Symbol
The unit representing duration of the interval.
27 28 29 |
# File 'lib/sentry/cron/monitor_schedule.rb', line 27 def unit @unit end |
#value ⇒ Integer
The number representing duration of the interval.
23 24 25 |
# File 'lib/sentry/cron/monitor_schedule.rb', line 23 def value @value end |
Instance Method Details
#to_hash ⇒ Object
36 37 38 |
# File 'lib/sentry/cron/monitor_schedule.rb', line 36 def to_hash { type: :interval, value: value, unit: unit } end |