Ruby Class Instance Javascript Interview Coding