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.
I agree: "Ghost objects are given a random color attribute"
The color is an "attribute" of the object. So it should not change with each call to
color
.Maybe the instructions have changed, but as they read now, I agree with vajdagabor. Currently the instructions say this:
ghost = Ghost.new
ghost.color #=> "white" or "yellow" or "purple" or "red"
In my reading, that means that the ghost object will always return the same color. The color is not returned on instantiation, it's returned on a the .color method call of that particular instance of the Ghost class.
I agree with eik3 definition of the expected task. I also though it should assing color only upon initialization. Yet Denym is totally right. If so, then the kata creator should of defined this with a test.
Then the submit test cases should be different :)
That's how I read the description, it says "given random color when instantiated". I expect a valid solution to work this way:
This comment is hidden because it contains spoiler information about the solution
Nice and clean solution, however the pageItemCount method is not correct:
Good call. I've sent a new solution with this corrected regexp:
/'?[a-z]+[a-z']*/i