Ruby: Basic system for pattern recognition