class AktivlearnStream::Config
Constants
- ALLOWED_SERVICE_TYPES
Public Class Methods
validate_config(config)
click to toggle source
# File lib/config.rb, line 6 def self.validate_config(config) begin @config = config || {} @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 return "Not a valid config,Error === #{e.message}" end end