Class: Reins::Configuration
- Inherits:
-
Object
- Object
- Reins::Configuration
- Defined in:
- lib/reins/configuration.rb
Constant Summary collapse
- DEFAULTS =
{ "development" => { eager_load: false, reload_classes: true, log_level: :debug }, "test" => { eager_load: false, reload_classes: false, log_level: :warn }, "production" => { eager_load: true, reload_classes: false, log_level: :info } }.freeze
Instance Attribute Summary collapse
-
#eager_load ⇒ Object
Returns the value of attribute eager_load.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#log_path ⇒ Object
Returns the value of attribute log_path.
-
#middleware ⇒ Object
readonly
Returns the value of attribute middleware.
-
#reload_classes ⇒ Object
Returns the value of attribute reload_classes.
Instance Method Summary collapse
-
#initialize(env) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(env) ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 19 20 21 22 |
# File 'lib/reins/configuration.rb', line 14 def initialize(env) env_defaults = DEFAULTS[env.to_s] || DEFAULTS["development"] @eager_load = env_defaults[:eager_load] @reload_classes = env_defaults[:reload_classes] @log_level = env_defaults[:log_level] @log_path = "log/#{env}.log" @middleware = MiddlewareStack.new install_default_middleware end |
Instance Attribute Details
#eager_load ⇒ Object
Returns the value of attribute eager_load.
5 6 7 |
# File 'lib/reins/configuration.rb', line 5 def eager_load @eager_load end |
#log_level ⇒ Object
Returns the value of attribute log_level.
5 6 7 |
# File 'lib/reins/configuration.rb', line 5 def log_level @log_level end |
#log_path ⇒ Object
Returns the value of attribute log_path.
5 6 7 |
# File 'lib/reins/configuration.rb', line 5 def log_path @log_path end |
#middleware ⇒ Object (readonly)
Returns the value of attribute middleware.
6 7 8 |
# File 'lib/reins/configuration.rb', line 6 def middleware @middleware end |
#reload_classes ⇒ Object
Returns the value of attribute reload_classes.
5 6 7 |
# File 'lib/reins/configuration.rb', line 5 def reload_classes @reload_classes end |