Class: RedisDashboard::Application
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- RedisDashboard::Application
- Defined in:
- lib/redis_dashboard/application.rb
Instance Method Summary collapse
Instance Method Details
#client ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'lib/redis_dashboard/application.rb', line 55 def client return @client if @client if url = RedisDashboard.urls.find { |url| URI(url).host == params[:server] } @client ||= RedisDashboard::Client.new(url) else raise Sinatra::NotFound end end |
#clients ⇒ Object
64 65 66 67 68 |
# File 'lib/redis_dashboard/application.rb', line 64 def clients @clients ||= RedisDashboard.urls.map do |url| RedisDashboard::Client.new(url) end end |
#close_clients ⇒ Object
70 71 72 73 |
# File 'lib/redis_dashboard/application.rb', line 70 def close_clients @client.close if @client @clients.each { |client| client.close } if @clients end |