Sha256: fe3dae981328afe36cf9cc37c957d1786ced00433d483567eb766fc1c3d6a422

Contents?: true

Size: 526 Bytes

Versions: 7

Compression:

Stored size: 526 Bytes

Contents

require 'real_page/utils'

module RealPage
  module Utils
    class ConfigurationValidator
      REQUIRED_KEYS = %i[username password license_key web_service_url].freeze
      private_constant :REQUIRED_KEYS

      def validate!
        missing_keys = REQUIRED_KEYS.select do |key|
          RealPage.config.send(key).nil?
        end
        unless missing_keys.empty?
          raise Error::InvalidConfiguration,
                "Missing configuration for #{missing_keys.join(', ')}"
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
real_page-2.3.6 lib/real_page/utils/configuration_validator.rb
real_page-2.3.5 lib/real_page/utils/configuration_validator.rb
real_page-2.3.4 lib/real_page/utils/configuration_validator.rb
real_page-2.3.3 lib/real_page/utils/configuration_validator.rb
real_page-2.3.2 lib/real_page/utils/configuration_validator.rb
real_page-2.3.1 lib/real_page/utils/configuration_validator.rb
real_page-2.3.0 lib/real_page/utils/configuration_validator.rb