Skip to content

Instantly share code, notes, and snippets.

@Musfuut
Created December 23, 2009 21:55
Show Gist options
  • Save Musfuut/262842 to your computer and use it in GitHub Desktop.
Save Musfuut/262842 to your computer and use it in GitHub Desktop.
def debug_line(*list)
ret = "Debug: "
0.step(list.length, 2) do |x|
label, value = list[x,x+1]
ret += "#{label} = '#{value}', "
end
puts ret
end
debug_line("a", 10, "b", 20)
# Should print "Debug: a = '10', b = '20', "
# For some reason the second value (10 in this case) is swallowed every time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment