Class: Elasticsearch::Client

Inherits:
Object
  • Object
show all
Includes:
API
Defined in:
lib/elasticsearch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments = {}, &block) ⇒ Client

See Elasticsearch::Transport::Client for initializer parameters



33
34
35
36
# File 'lib/elasticsearch.rb', line 33

def initialize(arguments = {}, &block)
  @verified = false
  @transport = Elasticsearch::Transport::Client.new(arguments, &block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



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

def method_missing(name, *args, &block)
  if name == :perform_request
    verify_elasticsearch unless @verified
    @transport.perform_request(*args, &block)
  else
    super
  end
end

Instance Attribute Details

#transportObject

Returns the value of attribute transport.



30
31
32
# File 'lib/elasticsearch.rb', line 30

def transport
  @transport
end