Class: EsHttpClient::Client

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

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Client

Returns a new instance of Client.



8
9
10
# File 'lib/es_http_client/client.rb', line 8

def initialize(connection)
  @connection = connection
end

Instance Method Details

#all_eventsObject



20
21
22
# File 'lib/es_http_client/client.rb', line 20

def all_events
  @all ||= ReadonlyStream.new("$all", @connection)
end

#resource(id) ⇒ Object



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

def resource(id)
  WriteableStream.new(id, @connection)
end

#stream(type, id) ⇒ Object



16
17
18
# File 'lib/es_http_client/client.rb', line 16

def stream(type, id)
  resource("#{type}-#{id}")
end