everypolitician/everypolitician-ruby

Define #to_s on Country and Legislature

Opened this issue · 1 comments

Add a #to_s method so that when a Country or Legislature is interpolated in a string it uses the name property of that object.

Current behaviour:

[1] pry(main)> country = Everypolitician.country('Australia')
=> #<Everypolitician::Country:0x007f99dc1e9628>
[2] pry(main)> "Fetching data for #{country}"
=> "Fetching data for #<Everypolitician::Country:0x007f99dc1e9628>"

Desired behaviour:

[1] pry(main)> country = Everypolitician.country('Australia')
=> #<Everypolitician::Country:0x007f99dc1e9628>
[2] pry(main)> "Fetching data for #{country}"
=> "Fetching data for Australia"

@octopusinvitro let's see how many of these you can clear tomorrow!