Class: Crntb::Line
- Inherits:
-
Object
- Object
- Crntb::Line
- Defined in:
- lib/crntb/line.rb
Instance Method Summary collapse
-
#initialize(line) ⇒ Line
constructor
A new instance of Line.
- #to_chef ⇒ Object
- #to_h ⇒ Object
- #to_json ⇒ Object
- #to_whenever ⇒ Object
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_chef ⇒ Object
19 20 21 |
# File 'lib/crntb/line.rb', line 19 def to_chef Crntb::Outputer::ChefCron.build(@entry) end |
#to_h ⇒ Object
11 12 13 |
# File 'lib/crntb/line.rb', line 11 def to_h Crntb::Outputer::Hash.build(@entry) end |
#to_json ⇒ Object
15 16 17 |
# File 'lib/crntb/line.rb', line 15 def to_json to_h.to_json end |