Module: Bixby::Debug

Defined in:
lib/bixby-common/util/debug.rb

Class Method Summary collapse

Class Method Details

.pretty_str(str) ⇒ Object

Simple helper for use in to_s methods



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/bixby-common/util/debug.rb', line 6

def self.pretty_str(str) # :nocov:
  if str.nil? then
    "nil"
  elsif str.empty? then
    '""'
  elsif str.include? "\n" then
    "<<-EOF\n" + str + "\nEOF"
  else
    '"' + str + '"'
  end
end