lib/xcres/logger.rb
# Coerces the given message or an exception to a string, and yields them as
# separated parameters to a block, which allows further handling.
#
# @param [#to_s] message_or_exception
#        Can be a String message or an exception
#
# @return [String,Exception?] message,exception
#         An array on first place is either the first argument or the
#         exception's message. If the given argument +message_or_exception+
#         is an exception, then it is the second element in the result.
#
Coerces the given message or an exception to a string, and yields them as
separated parameters to a block, which allows further handling.
Coerces the given message or an exception to a string and yields them as separated parameters to a block which allows further handling .
def coerce_to_message(message_or_exception)
    exception = nil
    if message_or_exception.kind_of? Exception
      exception = message_or_exception
      message = exception.message
    else
      message = message_or_exception.to_s
    end
    return message, exception
  end
def coerce_to_message ( message_or_exception ) exception = nil if message_or_exception . kind_of? Exception exception = message_or_exception message = exception . message else message = message_or_exception . to_s end return message , exception end
Coerces the given message or an exception to a string, and yields them as
separated parameters to a block, which allows further handling.
Coerces the given message or an exception to a string and yields them as separated parameters to a block which allows further handling .
message,exception An array on first place is either the first argument or the exception's message. If the given argument +message_or_exception+ is an exception, then it is the second element in the result.
message exception An array on first place is either the first argument or the exception ' s message . If the given argument + message_or_exception + is an exception then it is the second element in the result .
String,Exception?
message_or_exception
message_or_exception Can be a String message or an exception
message_or_exception Can be a String message or an exception