Module: Locd::Agent::Job::Types

Defined in:
lib/locd/agent/job.rb

Overview

Modules

Class Method Summary collapse

Class Method Details

.start_calendar_intervalObject



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/locd/agent/job.rb', line 22

def self.start_calendar_interval
  t.and(
    t.shape(
      minute:   t.maybe( t.non_neg_int ),
      hour:     t.maybe( t.non_neg_int ),
      day:      t.maybe( t.and( t.int, 0..31 ) ),
      weekday:  t.maybe( t.and( t.int, 0..7 ) ),
      month:    t.maybe( t.and( t.int, 0..11 ) ),
    ),
    # All values can't be `nil`
    t.not( t.hash_( values: nil ) ),
  )
end

.start_calendar_intervalsObject



36
37
38
# File 'lib/locd/agent/job.rb', line 36

def self.start_calendar_intervals
  t.array start_calendar_interval
end