lib/scheherazade/character_builder.rb
def canonical(attribute_list)
      case attribute_list
      when nil then {}
      when Hash then attribute_list
      when Array
        attribute_list.map do |attributes|
          case attributes
          when Symbol
            {attributes => AUTO}
          when Hash
            attributes
          else
            raise "Unexpected attributes #{attributes}"
          end
        end
        .inject({}, :merge)
      else
        raise "Unexpected attribute_list #{attribute_list}"
      end
    end
def canonical(attribute_list)
      case attribute_list
      when nil then {}
      when Hash then attribute_list
      when Array
        attribute_list.map do |attributes|
          case attributes
          when Symbol
            {attributes => AUTO}
          when Hash
            attributes
          else
            raise "Unexpected attributes #{attributes}"
          end
        end
        .inject({}, :merge)
      else
        raise "Unexpected attribute_list #{attribute_list}"
      end
    end
Converts an attribute_list to a single Hash;
 some of the values may be set to AUTO.

   canonical [:foo, {:bar => 42}]
    # => {:foo => AUTO, :bar => 42}