Skip to content

Instantly share code, notes, and snippets.

@elskwid
Created April 9, 2015 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elskwid/e124c965b5864166310f to your computer and use it in GitHub Desktop.
Save elskwid/e124c965b5864166310f to your computer and use it in GitHub Desktop.
Warmup for TECH603 day 6
# 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