Module: Rubycom::OutputHandler
- Defined in:
- lib/rubycom/output_handler.rb
Class Method Summary collapse
-
.process_output(command_result) ⇒ Object
Prints the command_result if it is a basic type or a Yaml representation of command_result if it is not basic types: String, NilClass, TrueClass, FalseClass, Fixnum, Float, Symbol.
Class Method Details
.process_output(command_result) ⇒ Object
Prints the command_result if it is a basic type or a Yaml representation of command_result if it is not basic types: String, NilClass, TrueClass, FalseClass, Fixnum, Float, Symbol
8 9 10 11 12 |
# File 'lib/rubycom/output_handler.rb', line 8 def self.process_output(command_result) std_output = nil std_output = command_result.to_yaml unless [String, NilClass, TrueClass, FalseClass, Fixnum, Float, Symbol].include?(command_result.class) $stdout.puts std_output || command_result end |