| Class | CronEdit::CronEntry |
| In: |
lib/cronedit.rb
|
| Parent: | Object |
| DEFAULTS | = | { :minute => '*', :hour => '*', :day => '*', :month => '*', :weekday => '*', :command => '' |
| WDAY | = | %w(sun mon tue wed thu fri sut) |
Hash def, or raw String def
# File lib/cronedit.rb, line 421
421: def initialize aDef = {}
422: if aDef.kind_of? Hash
423: wrong = aDef.collect { |k,v| DEFAULTS.include?(k) ? nil : k}.compact
424: raise "Wrong definition, invalid constructs #{wrong}" unless wrong.empty?
425: @defHash = DEFAULTS.merge aDef
426: # TODO: validate values
427: @def = to_raw @defHash ;
428: else
429: @defHash = parseTextDef aDef
430: @def = aDef;
431: end
432: end