def configuration(name, type)
      default_settings = default_settings_for_type(type)
      configurations = configurations_of_type(type)

      build_configuration = if name.nil?
                              configurations.first
                            else
                              configurations.detect do |c|
                                c.name == name.to_s
                              end
                            end

      if build_configuration.nil?

        name = type.to_s.capitalize if name.nil?

        build_configuration = Configuration.new(name) do |b|
          b.type = type
          b.settings.merge!(default_settings)

          yield(b) if block_given?
        end

        @configurations ||= []
        @configurations << build_configuration
      end

      build_configuration
    end
def configuration(name, type)
      default_settings = default_settings_for_type(type)
      configurations = configurations_of_type(type)

      build_configuration = if name.nil?
                              configurations.first
                            else
                              configurations.detect do |c|
                                c.name == name.to_s
                              end
                            end

      if build_configuration.nil?

        name = type.to_s.capitalize if name.nil?

        build_configuration = Configuration.new(name) do |b|
          b.type = type
          b.settings.merge!(default_settings)

          yield(b) if block_given?
        end

        @configurations ||= []
        @configurations << build_configuration
      end

      build_configuration
    end
This either finds a configuration
 with the same name and type or creates one.

 @return [Configuration] the new or existing configuration