Class: Crntb::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/crntb/line.rb

Instance Method Summary collapse

Constructor Details

#initialize(line) ⇒ Line

Returns a new instance of Line.



6
7
8
9
# File 'lib/crntb/line.rb', line 6

def initialize(line)
  return if line.empty?
  @entry = ::Crontab::Entry.parse(line)
end

Instance Method Details

#to_chefObject



19
20
21
# File 'lib/crntb/line.rb', line 19

def to_chef
  Crntb::Outputer::ChefCron.build(@entry)
end

#to_hObject



11
12
13
# File 'lib/crntb/line.rb', line 11

def to_h
  Crntb::Outputer::Hash.build(@entry)
end

#to_jsonObject



15
16
17
# File 'lib/crntb/line.rb', line 15

def to_json
  to_h.to_json
end

#to_wheneverObject



23
24
25
# File 'lib/crntb/line.rb', line 23

def to_whenever
  Crntb::Outputer::Whenever.build(@entry)
end