doximity/es-elasticity

View on GitHub
lib/elasticity/config.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Elasticity
  class Config
    def client=(client)
      @client = Elasticity::InstrumentedClient.new(client)
    end

    def client
      return @client if defined?(@client)
      self.client = Elasticsearch::Client.new
      @client
    end

    attr_writer :settings, :namespace, :pretty_json

    def settings
      return @settings if defined?(@settings)
      @settings = {}
    end

    def namespace
      @namespace
    end

    def pretty_json
      @pretty_json || false
    end
  end
end