Class: SSHKit::Formatter::SimpleText

Inherits:
Abstract
  • Object
show all
Defined in:
lib/sshkit/formatters/simple_text.rb

Instance Attribute Summary

Attributes inherited from Abstract

#original_output

Instance Method Summary collapse

Methods inherited from Abstract

#initialize

Constructor Details

This class inherits a constructor from SSHKit::Formatter::Abstract

Instance Method Details

#write(obj) ⇒ Object Also known as: <<



8
9
10
11
12
13
14
15
16
# File 'lib/sshkit/formatters/simple_text.rb', line 8

def write(obj)
  return if obj.verbosity < SSHKit.config.output_verbosity
  case obj
  when SSHKit::Command    then write_command(obj)
  when SSHKit::LogMessage then write_log_message(obj)
  else
    original_output << "Output formatter doesn't know how to handle #{obj.class}\n"
  end
end