title: How do I refer to a class with a Symbol in Ruby?
body: <p>I want to make a Hash whose keys refer to the symbol of a class and the value some array which has, for example, colours that refer to that specific class. As of now, my implementation is this one:</p>
  
  <pre><code>module DomesticAnimal
      attr_accessor :name
  
      def eat(food)
          puts "Eating #{food}"
      end
  end
  
  module AnimalColours #Lo separo para realizar más abstracción
      @@colours = {
          :dog =&gt; ["White", "Grey", "Black", "Brown"],
          :cat =&gt; ["White", "Black"],
      }
  
      def self.hasColour(type, colour)
          if @@colours[type] != nil
              @@colours[type].each do |x|
                  return true unless x != colour
              end
          end
          return false
      end
  end
  
  class Dog
      include DomesticAnimal
  
      def initialize(name, colour)
          @name = name
  
          if AnimalColours.hasColour(:dog, colour)
              @colour = colour
          else
              raise "Colour error"
          end
      end
  
      def goOut(place)
          puts "#{name} when out for a walk to #{place}"
      end
  end
  
  dog = Dog.new("Juan", "Black")
  
  dog.goOut("the park")
  </code></pre>