Class: EsHttpClient::Client
- Inherits:
-
Object
- Object
- EsHttpClient::Client
- Defined in:
- lib/es_http_client/client.rb
Instance Method Summary collapse
- #all_events ⇒ Object
-
#initialize(connection) ⇒ Client
constructor
A new instance of Client.
- #resource(id) ⇒ Object
- #stream(type, id) ⇒ Object
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_events ⇒ Object
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 |