Class: Eye::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/eye-http/extend_eye.rb

Instance Method Summary collapse

Instance Method Details

#set_opt_http(params = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/eye-http/extend_eye.rb', line 8

def set_opt_http(params = {})
  if params[:enable]
    if @http
      if params[:host] != @http.host || params[:port].to_i != @http.port
        stop_http
        start_http(params[:host], params[:port])
      end
    else
      start_http(params[:host], params[:port])
    end
  else
    stop_http if @http
  end
end