12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/config.rb', line 12
def self.validate_config
begin
@config["type_of_service"] || raise(StandardError.new('Specify the servcie type'))
@config["service_key"] || raise(StandardError.new('Service Key is missing, please specify in config'))
@config["service_secret"] || raise(StandardError.new('Service Secret is missing, please specify in config'))
@config["delivery_stream_name"] || raise(StandardError.new('Delivery Stream Name is missing, please specify in config'))
@config["region"] || raise(StandardError.new('Specify the Region'))
raise(StandardError.new('This type of servcie is not supported')) unless ALLOWED_SERVICE_TYPES.include?(@config["type_of_service"])
rescue Exception => e
raise(StandardError.new("Not a valid config, #{e.message}"))
end
end
|