Class: Cannon::Config
- Inherits:
-
Object
- Object
- Cannon::Config
- Defined in:
- lib/cannon/config.rb
Defined Under Namespace
Classes: Cookies
Constant Summary collapse
- DEFAULT_MIDDLEWARE =
%w{RequestLogger Files Cookies Router ContentType}
- LOG_LEVELS =
{ unknown: Logger::UNKNOWN, fatal: Logger::FATAL, error: Logger::ERROR, warn: Logger::WARN, info: Logger::INFO, debug: Logger::DEBUG, }
Instance Attribute Summary collapse
-
#benchmark_requests ⇒ Object
Returns the value of attribute benchmark_requests.
-
#ip_address ⇒ Object
Returns the value of attribute ip_address.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#middleware ⇒ Object
Returns the value of attribute middleware.
-
#port ⇒ Object
Returns the value of attribute port.
-
#public_path ⇒ Object
Returns the value of attribute public_path.
-
#reload_on_request ⇒ Object
Returns the value of attribute reload_on_request.
-
#view_path ⇒ Object
Returns the value of attribute view_path.
Instance Method Summary collapse
- #cookies ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/cannon/config.rb', line 19 def initialize self.ip_address = '127.0.0.1' self.port = 5030 self.middleware = DEFAULT_MIDDLEWARE self.public_path = 'public' self.view_path = 'views' self.reload_on_request = false self.benchmark_requests = true @log_level = :info self.logger = Logger.new(STDOUT) end |
Instance Attribute Details
#benchmark_requests ⇒ Object
Returns the value of attribute benchmark_requests.
5 6 7 |
# File 'lib/cannon/config.rb', line 5 def benchmark_requests @benchmark_requests end |
#ip_address ⇒ Object
Returns the value of attribute ip_address.
5 6 7 |
# File 'lib/cannon/config.rb', line 5 def ip_address @ip_address end |
#log_level ⇒ Object
Returns the value of attribute log_level.
6 7 8 |
# File 'lib/cannon/config.rb', line 6 def log_level @log_level end |
#logger ⇒ Object
Returns the value of attribute logger.
6 7 8 |
# File 'lib/cannon/config.rb', line 6 def logger @logger end |
#middleware ⇒ Object
Returns the value of attribute middleware.
5 6 7 |
# File 'lib/cannon/config.rb', line 5 def middleware @middleware end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/cannon/config.rb', line 5 def port @port end |
#public_path ⇒ Object
Returns the value of attribute public_path.
5 6 7 |
# File 'lib/cannon/config.rb', line 5 def public_path @public_path end |
#reload_on_request ⇒ Object
Returns the value of attribute reload_on_request.
5 6 7 |
# File 'lib/cannon/config.rb', line 5 def reload_on_request @reload_on_request end |
#view_path ⇒ Object
Returns the value of attribute view_path.
5 6 7 |
# File 'lib/cannon/config.rb', line 5 def view_path @view_path end |