Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define #to_s on Country and Legislature #5

Open
chrismytton opened this issue Jan 6, 2016 · 1 comment
Open

Define #to_s on Country and Legislature #5

chrismytton opened this issue Jan 6, 2016 · 1 comment
Assignees

Comments

@chrismytton
Copy link
Contributor

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"
@tmtmtmtm
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants