Class: Isolator::Configuration
- Inherits:
-
Object
- Object
- Isolator::Configuration
- Defined in:
- lib/isolator/configuration.rb
Overview
Isolator configuration:
-
‘raise_exceptions` - whether to raise an exception in case of offense; defaults to true in test env and false otherwise. NOTE: env is infered from RACK_ENV and RAILS_ENV.
-
‘logger` - logger instance (nil by default)
-
‘send_notifications` - whether to send notifications (through uniform_notifier); defauls to false
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#raise_exceptions ⇒ Object
(also: #raise_exceptions?)
Returns the value of attribute raise_exceptions.
-
#send_notifications ⇒ Object
(also: #send_notifications?)
Returns the value of attribute send_notifications.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #test_env? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
17 18 19 20 21 |
# File 'lib/isolator/configuration.rb', line 17 def initialize @logger = nil @raise_exceptions = test_env? @send_notifications = false end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
15 16 17 |
# File 'lib/isolator/configuration.rb', line 15 def logger @logger end |
#raise_exceptions ⇒ Object Also known as: raise_exceptions?
Returns the value of attribute raise_exceptions.
15 16 17 |
# File 'lib/isolator/configuration.rb', line 15 def raise_exceptions @raise_exceptions end |
#send_notifications ⇒ Object Also known as: send_notifications?
Returns the value of attribute send_notifications.
15 16 17 |
# File 'lib/isolator/configuration.rb', line 15 def send_notifications @send_notifications end |
Instance Method Details
#test_env? ⇒ Boolean
26 27 28 |
# File 'lib/isolator/configuration.rb', line 26 def test_env? ENV["RACK_ENV"] == "test" || ENV["RAILS_ENV"] == "test" end |