Created
April 9, 2015 23:18
-
-
Save elskwid/e124c965b5864166310f to your computer and use it in GitHub Desktop.
Warmup for TECH603 day 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Create a class named Country | |
# 2. Add read/write support for the following attributes: | |
# :id | |
# :name | |
# :population | |
# :capital | |
# 3. Create an instance of your Country class | |
# 4. Set the attributes for Angola: | |
# "id" => "AGO" | |
# "name" => "Angola" | |
# "population" => 21_471_618 | |
# "capital" => "Luanda" | |
# 5. Add a to_s method for the country that displays all of the attributes: | |
# | |
# angola.to_s | |
# # => "Angola [AGO], capital: Luanda, population: 21471618. | |
# 6. Show an example of code that will call the method you just defined without | |
# explicitly calling it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment