Class: IndexTank::Client
- Inherits:
-
Object
- Object
- IndexTank::Client
- Defined in:
- lib/indextank/client.rb
Instance Attribute Summary collapse
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #indexes(name = nil) ⇒ Object
-
#initialize(api_url) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(api_url) ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 13 |
# File 'lib/indextank/client.rb', line 8 def initialize(api_url) @uri = api_url @conn = IndexTank.setup_connection(api_url) do |faraday| faraday.use ClientResponseMiddleware end end |
Instance Attribute Details
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
6 7 8 |
# File 'lib/indextank/client.rb', line 6 def uri @uri end |
Instance Method Details
#indexes(name = nil) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/indextank/client.rb', line 15 def indexes(name = nil) if name.nil? list_indexes else get_index(name) end end |