Graph tool: conform to Ruby style guide.

Closes #1529.