Class: Ksql::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/ksql/configuration.rb

Overview

Ksql configuration

Constant Summary collapse

REQUIRED_ATTRS =
%i[host].freeze
OPTIONAL_ATTRS =
%i[auth].freeze

Instance Method Summary collapse

Instance Method Details

#validateBoolean

Ensure required attributes are properly configured

Returns:

  • (Boolean)

    true



20
21
22
23
24
25
26
27
# File 'lib/ksql/configuration.rb', line 20

def validate
  REQUIRED_ATTRS.each do |attribute|
    value = instance_variable_get("@#{attribute}")
    raise ConfigurationError, "Ksql required #{attribute} missing!" if value.nil? || value.strip.empty?
  end

  true
end