class Ej::Values

Attributes

client[R]
index[R]
logger[R]

Public Class Methods

new(global_options) click to toggle source
# File lib/ej/values.rb, line 7
def initialize(global_options)
  @logger =  Logger.new($stderr)
  @logger.level = global_options[:debug] ? Logger::DEBUG : Logger::INFO
  @client = get_client(global_options[:host], global_options[:index], global_options[:user], global_options[:password])
  @index = global_options[:index]
end

Public Instance Methods

get_client(host_string, index, user, password) click to toggle source
# File lib/ej/values.rb, line 14
def get_client(host_string, index, user, password)
  hosts = Util.parse_hosts(host_string, user, password)
  ::Elasticsearch::Client.new transport: Util.get_transport(hosts), index: index, logger: @logger
end