Class: Reindexer::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/reindexer/client.rb

Constant Summary collapse

DEFAULT_PORT =
16534

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.



39
40
41
42
43
44
45
# File 'lib/reindexer/client.rb', line 39

def initialize(options)
  @config = parse_config(options)
  @connection = ::Reindexer::Grpc::Reindexer::Stub.new(
    "#{config[:host]}:#{config[:port] || DEFAULT_PORT}",
    :this_channel_is_insecure
  )
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



10
11
12
# File 'lib/reindexer/client.rb', line 10

def config
  @config
end

#connectionObject (readonly)

Returns the value of attribute connection.



10
11
12
# File 'lib/reindexer/client.rb', line 10

def connection
  @connection
end

Class Method Details

.build_request_name(name) ⇒ Object



12
13
14
# File 'lib/reindexer/client.rb', line 12

def self.build_request_name(name)
  name.to_s.gsub(/(.)([A-Z])/, '\1_\2').downcase.to_sym
end