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