Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Vehicle, Automobile & Motorcycle classes with required options #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pdai1y
Copy link

@pdai1y pdai1y commented Apr 5, 2014

I'm sure there is an easier way for me to return a value from a method rather than what I have done here.

I'm also learning Rspec as I go along, its been about 2 weeks since I've really taken a stab at learning Ruby..

Any suggestions on making better tests?

Edit: Panda & Tiger level included

##
# Initialize new vehicle; if no arguments are provided, default to "None"
def initialize(args)
@color = args[:color] ||= "None"
Copy link
Member

Choose a reason for hiding this comment

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

This works, but I prefer using "fetch" in this circumstance:

@color = args.fetch(:color, "None")

@jwo
Copy link
Member

jwo commented Apr 7, 2014

Your tests are great -- nothing to add there.

The updater method was perfect as well.

Sign up for free to 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