@hollymichel
No, it doesn't read a lot better.
You must add the 'code' tag and put your Ruby code inside it.
Then the start and end tags [i.e. three back-quotes each: note I put spaces in front here to prevent the forum thinking it was more code...

``` ### ruby code text goes here ```

] they must both be on their own lines.
Which looks like this in the post.

### ruby code text goes here

Simplify your process, and make it more complex only when you've got some good results.
Trying to do it all in one go is just too difficult.

How do you eat an elephant - take small bites !