Class: Whenever::Output::Cron::OutputRedirection

Inherits:
Object
  • Object
show all
Defined in:
lib/whenever/outputs/cron/output_redirection.rb

Instance Method Summary collapse

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_sObject



10
11
12
13
14
15
16
17
18
# 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 NilClass then ">> /dev/null 2>&1"
    else ''
  end 
end