From 21064d74f3924c5e1ba1624f55ec1f3b634c37ac Mon Sep 17 00:00:00 2001 From: Mike Adeleke Date: Sun, 1 Dec 2013 16:44:51 -0500 Subject: [PATCH] Finished but with a fair bit of questions --- block_review.rb | 31 +++++++++++++++++++++++++++++++ models/panda.rb | 24 ++++++++++++++++++++++++ spec/block_review_spec.rb | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 models/panda.rb create mode 100644 spec/block_review_spec.rb diff --git a/block_review.rb b/block_review.rb index fcdefc7..381dc51 100644 --- a/block_review.rb +++ b/block_review.rb @@ -5,3 +5,34 @@ Dir.glob("./**/*.rb").each {|f| require f} puts "Serenity now!" + +class Automobile < ActiveRecord::Base + def initialize + @color = color + @make = make + @model = model + @year = year + end + + def number_of_tires + 4 + end +end + +automobile = {color: "Black", make: "SUV", model: "Range Rover", year: 2013} +puts automobile + +class Vehicle < Automobile + @@count = Vehicle.count + + def blue_honda_accords + #not sure here + end +end + +class Motorcycle < Automobile + def number_of_tires + 2 + end +end + diff --git a/models/panda.rb b/models/panda.rb new file mode 100644 index 0000000..6c0964b --- /dev/null +++ b/models/panda.rb @@ -0,0 +1,24 @@ +class Automobile < ActiveRecord::Base + def initialize + @color = color + @make = make + @model = model + @year = year + end + + def number_of_tires + 4 + end +end + +automobile = {color: "Black", make: "SUV", model: "Range Rover", year: 2013} + +class Vehicle < Automobile +end + +class Motorcycle < Automobile + def number_of_tires + 2 + end +end + diff --git a/spec/block_review_spec.rb b/spec/block_review_spec.rb new file mode 100644 index 0000000..5925a93 --- /dev/null +++ b/spec/block_review_spec.rb @@ -0,0 +1,32 @@ +class Automobile +end + +class Vehicle +end + +class Motorcycle +end + +describe Automobile do + it "should have a attributes" do + @color = color + @make = make + @model = model + @year = year + end + it "should have 4 tires" do + number_of_tires = 4 + end +end + +describe Vehicle do + it "should have a count" do + #not sure what to do here + end +end + +describe Motorcycle do + it "should have two tires" do + number_of_tires == 2 + end +end