Class: Reindexer::Client
- Inherits:
-
Object
- Object
- Reindexer::Client
- Defined in:
- lib/reindexer/client.rb
Constant Summary collapse
- DEFAULT_PORT =
16534
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
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() @config = parse_config() @connection = ::Reindexer::Grpc::Reindexer::Stub.new( "#{config[:host]}:#{config[:port] || DEFAULT_PORT}", :this_channel_is_insecure ) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
10 11 12 |
# File 'lib/reindexer/client.rb', line 10 def config @config end |
#connection ⇒ Object (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 |