Class: IndexTanked::IndexTank::Client
- Inherits:
-
Object
- Object
- IndexTanked::IndexTank::Client
- Defined in:
- lib/index-tanked/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.
9 10 11 12 13 14 |
# File 'lib/index-tanked/indextank/client.rb', line 9 def initialize(api_url) @uri = api_url @conn = IndexTanked::IndexTank.setup_connection(api_url) do |faraday| faraday.use ClientResponseMiddleware end end |
Instance Attribute Details
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
7 8 9 |
# File 'lib/index-tanked/indextank/client.rb', line 7 def uri @uri end |
Instance Method Details
#indexes(name = nil) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/index-tanked/indextank/client.rb', line 16 def indexes(name = nil) if name.nil? list_indexes else get_index(name) end end |