Module: Kernel

Defined in:
lib/kernel.rb

Instance Method Summary collapse

Instance Method Details

#p(*args) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/kernel.rb', line 4

def p(*args)
  raw = caller(1..1).first
  source = Betterp::Source.new(raw, Dir.pwd)

  Betterp::Output.new(raw, source).format(args).each do |output|
    STDOUT.write(output + "\n")
  end

  args.size > 1 ? args : args.first
end