class ConsulApplicationSettings::Providers::Consul

Provides access to settings stored in Consul

Public Instance Methods

get(path) click to toggle source
# File lib/consul_application_settings/providers/consul.rb, line 7
def get(path)
  full_path = absolute_key_path(path)
  value = get_from_consul(full_path)
  ConsulApplicationSettings::Utils.cast_consul_value(value)
end

Private Instance Methods

get_from_consul(path) click to toggle source
# File lib/consul_application_settings/providers/consul.rb, line 15
def get_from_consul(path)
  Diplomat::Kv.get(path, {})
rescue Diplomat::KeyNotFound
  return nil
rescue SystemCallError, Faraday::ConnectionFailed, Diplomat::PathNotFound => e
  raise e unless @config.disable_consul_connection_errors
end