Skip to content

Conversation

annavester
Copy link

Panda and Tiger

Copy link
Member

Choose a reason for hiding this comment

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

You don't have to use 'return' in Ruby... the last executed code in a method will always return. You can use returns to early return a method, something like this:

attr_reader :my_tent

def default_tent
  return 5 if my_tent.nil?
  calculate_tent
end

@jwo
Copy link
Member

jwo commented Nov 20, 2012

Great job on this assignment!

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