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"
Add a
#to_s
method so that when aCountry
orLegislature
is interpolated in a string it uses thename
property of that object.Current behaviour:
Desired behaviour: