Class: RedisDashboard::Application

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/redis_dashboard/application.rb

Instance Method Summary collapse

Instance Method Details

#clientObject



43
44
45
# File 'lib/redis_dashboard/application.rb', line 43

def client
  @client ||= RedisDashboard::Client.new(RedisDashboard.urls[redis_id.to_i])
end

#clientsObject



47
48
49
50
51
# File 'lib/redis_dashboard/application.rb', line 47

def clients
  @clients ||= RedisDashboard.urls.map do |url|
    RedisDashboard::Client.new(url)
  end
end

#close_clientsObject



53
54
55
56
# File 'lib/redis_dashboard/application.rb', line 53

def close_clients
  @client.close if @client
  @clients.each { |client| client.close } if @clients
end