Skip to content

Done(Panda, Tiger, Eagle) - #14

Open
var114 wants to merge 11 commits into
RubyoffRails:masterfrom
var114:master
Open

Done(Panda, Tiger, Eagle)#14
var114 wants to merge 11 commits into
RubyoffRails:masterfrom
var114:master

Conversation

@var114

Copy link
Copy Markdown

No description provided.

Comment threadspec/vehicle_spec.rb Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In RSpec, it has cool matchers that I like to point out. You could rewrite this methot as:

Vehicle.wheels.shouldbe_nil

@jwo

jwo commented Nov 19, 2013

Copy link
Copy Markdown
Member

Looks pretty great!

The only thing I wasn't 100% on was the self.wheels --- In it, you are setting a variable and returning it.

classVehicle@@wheels=0defself.wheels@@wheelsendend

Then in your motorcycle, you can override the @@wheels

classMotorcylcle < Vehicle@@wheels=2endVehicle.wheels=>0Motorcycle.wheels=>2

OR, possibly event simpler (but without using class variables):

classVehicleWHEEL_COUNT=0defself.wheelsWHEEL_COUNTendendclassMotorcycle < VehicleWHEEL_COUNT=2endputsMotorcycle.wheels=>2

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@var114@jwo