Blocks: Review

Readme Homework

Episode 6 - Block Review

Technical Stuff for things you now know.

The List

  1. class definitions
  2. Hash data-dictionary
  3. symbols and strings
  4. Instance Variables
  5. local variables
  6. requiring external files
  7. test suites
  8. Database connections
  9. Database Access (ActiveRecord)
  10. Isolated Testing
  11. class methods
  12. Array/Collection/Enumeration methods (map, select)
  13. Import from CSV (episode 4, free)
  14. Load a file into a string
  15. configuration values in YML

Panda Assignment

  1. Create a class definition for an automobile
  2. The class should have the following characteristics:
    • Should have a class method that returns the number of wheels it has
    • Should have instance variables for color, make, model, and year
    • I should be able to pass in a hash of color, make, model, and year to the class to update its variables

Tiger Assignment

  1. Create a Vehicle class that automobile inherits from
  2. Create a Motorcycle class that inherits from vehicle
  3. Show the motorcycle class overriding the vehicle's class method for number of tires

Eagle Assignment

  1. Create a class variable (@@) in the Vehicle that tracks all vehicles mde
  2. Create a class method that let's you filter the vehicles to only blue honda accords (using our enuerable filters)
  3. Do it all using TDD (of course!)


Copyright Jesse Wolgamott 2012, MIT License. See LICENSE

Blocks: Review

  • Area:

  • Runtime:

  • Tech:

  • Tags:

    rspec ruby  

The block review goes over some aspects of Ruby in a classic teaching method. We don't create an application this week. Instead, I try to formalize some of the aspects and techniques you've been seeing and using in the previous 5 weeks.

If you've been having trouble picking up some of the nuances of Ruby watching applications being created, this is a good way to see what's what.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.


Ruby Off Rails is dedicated to accelerating the mastering of Ruby and increasing developer happiness everywhere.

In my software training, I see two distinct sets of programmers: those who know Ruby, and those who haven’t learned it yet. People who learn Ruby have an easier time understanding Rails, gems, and what magic voodoo is going on. And most importantly, they can cast wicked voodoo themselves.