Skip to content

Instantly share code, notes, and snippets.

@elskwid
Created April 8, 2015 00:17
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/687ee5667acb847a4237 to your computer and use it in GitHub Desktop.
Save elskwid/687ee5667acb847a4237 to your computer and use it in GitHub Desktop.
Warmup for TECH603 Day 5
# 1. Create a class named Country
# 2. Add the ability to read and write an attribute named "name". This should
# be done using two methods.
# HINT: the writer method has the `=` at the end
# HINT HINT: use an ivar to store the name in the scope of the class
# 3. Create an instance of your Country class
# 4. Set the name attribute
# 5. Get and display the name attribute
# 6. Add support to read and write an attribute named "id", but this time use
# the Ruby macros for readers and writers.
# 7. Set and get the id attribute
# 8. Modify country to allow you to pass the name and id in when the country
# is created.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment