A simple Animal object factory implemented as both a Ruby class and a JavaScript prototype