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