Class: Sail::Types::Cron

Inherits:
Type
  • Object
show all
Defined in:
lib/sail/types/cron.rb

Overview

Cron

The Cron type returns true if the saved cron string matches the current time (ignores seconds).

Instance Method Summary collapse

Methods inherited from Type

#from, #initialize

Constructor Details

This class inherits a constructor from Sail::Types::Type

Instance Method Details

#to_valueObject



12
13
14
# File 'lib/sail/types/cron.rb', line 12

def to_value
  Fugit::Cron.new(@setting.value).match?(DateTime.now.utc.change(sec: 0))
end