class Utils::ProbeServer
def output_message(msg, type: nil)
-
(Utils::ProbeServer)
- returns self to allow for method chaining
Parameters:
-
type
(Symbol
) -- the type of message for styling (success, info, warn, failure) -
msg
(String, Array
) -- the message to be displayed
def output_message(msg, type: nil) msg.respond_to?(:to_a) and msg = msg.to_a * "\n" msg = case type when :success on_color(22) { white { msg } } when :info on_color(20) { white { msg } } when :warn on_color(94) { white { msg } } when :failure on_color(124) { blink { white { msg } } } else msg end STDOUT.puts msg STDOUT.flush self end