Module: Crntb::Outputer::Hash

Defined in:
lib/crntb/outputer/hash.rb

Class Method Summary collapse

Class Method Details

.build(entry) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/crntb/outputer/hash.rb', line 5

def build(entry)
  fields = entry.cron_definition.split(/\s/, 5)

  {
    "minute":       fields[0],
    "hour":         fields[1],
    "day_of_month": fields[2],
    "month":        fields[3],
    "day_of_week":  fields[4],
    "command":      entry.command
  }
end