Florent2/Watts-Strogatz-model-network-generator — Issue #8: #to_s should return a string
Author: semmons99
Created: 2012-01-25 14:12:20+00:00
State: open

Currently [Network#to_s](https://github.com/Florent2/Watts-Strogatz-model-network-generator/blob/master/lib/wsmodel/network.rb#L88) uses `puts` to output itself. This is incorrect behavior. `#to_s` contract implies that it returns a string without side-effects. I believe your intention here is to display the network. You could take one of two approaches. Create a `NetworkDisplayer` class which takes a `Network` object as input as outputs the network to the screen, or a simpler approach of just changing `#to_s` to `#print_to_console` or similar.