Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
You only
def initialize
when you need the object to do something when created (i.e. when.new
is called). In that case, we only need to check for the name and password when we receive one so we don't need initialize to do anything.It's the most straightforward way in Ruby AFAIK. Maybe handling the case where
str.nil? == true
makes for a bulletproof answer, but the tests don't run thenil
value, so you can get away without.