Class: Whenever::Output::Cron::OutputRedirection
- Inherits:
-
Object
- Object
- Whenever::Output::Cron::OutputRedirection
- Defined in:
- lib/whenever/outputs/cron/output_redirection.rb
Instance Method Summary collapse
-
#initialize(output) ⇒ OutputRedirection
constructor
A new instance of OutputRedirection.
- #to_s ⇒ Object
Constructor Details
#initialize(output) ⇒ OutputRedirection
Returns a new instance of OutputRedirection.
6 7 8 |
# File 'lib/whenever/outputs/cron/output_redirection.rb', line 6 def initialize(output) @output = output end |
Instance Method Details
#to_s ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/whenever/outputs/cron/output_redirection.rb', line 10 def to_s return '' unless defined?(@output) case @output when String then redirect_from_string when Hash then redirect_from_hash when Symbol then redirect_from_symbol when NilClass then ">> /dev/null 2>&1" else '' end end |