Module: Eye::Controller::Options

Included in:
Eye::Controller
Defined in:
lib/eye/controller/options.rb

Instance Method Summary collapse

Instance Method Details

#set_opt_http(params = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/eye/controller/options.rb', line 14

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

#set_opt_logger(logger_args) ⇒ Object



3
4
5
6
7
8
# File 'lib/eye/controller/options.rb', line 3

def set_opt_logger(logger_args)
  # do not apply logger, if in stdout state
  if !%w{stdout stderr}.include?(Eye::Logger.dev)
    Eye::Logger.link_logger(*logger_args)
  end
end

#set_opt_logger_level(level) ⇒ Object



10
11
12
# File 'lib/eye/controller/options.rb', line 10

def set_opt_logger_level(level)
  Eye::Logger.log_level = level
end