Class: Isolator::Configuration
- Inherits:
-
Object
- Object
- Isolator::Configuration
- Defined in:
- lib/isolator/configuration.rb,
lib/isolator/plugins/database_subtransactions.rb,
lib/isolator/plugins/concurrent_database_transactions.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 inferred from RACK_ENV and RAILS_ENV.
-
‘logger` - logger instance (nil by default)
-
‘send_notifications` - whether to send notifications (through uniform_notifier); defaults to false
-
‘backtrace_filter` - define a custom backtrace filtering (provide a callable)
-
‘ignorer` - define a custom ignorer (must implement .prepare)
Instance Attribute Summary collapse
-
#backtrace_filter ⇒ Object
Returns the value of attribute backtrace_filter.
-
#disallow_per_thread_concurrent_transactions ⇒ Object
(also: #disallow_per_thread_concurrent_transactions?)
Returns the value of attribute disallow_per_thread_concurrent_transactions.
-
#ignorer ⇒ Object
Returns the value of attribute ignorer.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#max_subtransactions_depth ⇒ Object
Returns the value of attribute max_subtransactions_depth.
-
#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.
23 24 25 26 27 28 29 |
# File 'lib/isolator/configuration.rb', line 23 def initialize @logger = nil @raise_exceptions = test_env? @send_notifications = false @backtrace_filter = ->(backtrace) { backtrace.take(5) } @ignorer = Isolator::Ignorer end |
Instance Attribute Details
#backtrace_filter ⇒ Object
Returns the value of attribute backtrace_filter.
20 21 22 |
# File 'lib/isolator/configuration.rb', line 20 def backtrace_filter @backtrace_filter end |
#disallow_per_thread_concurrent_transactions ⇒ Object Also known as: disallow_per_thread_concurrent_transactions?
Returns the value of attribute disallow_per_thread_concurrent_transactions.
5 6 7 |
# File 'lib/isolator/plugins/concurrent_database_transactions.rb', line 5 def disallow_per_thread_concurrent_transactions @disallow_per_thread_concurrent_transactions end |
#ignorer ⇒ Object
Returns the value of attribute ignorer.
20 21 22 |
# File 'lib/isolator/configuration.rb', line 20 def ignorer @ignorer end |
#logger ⇒ Object
Returns the value of attribute logger.
20 21 22 |
# File 'lib/isolator/configuration.rb', line 20 def logger @logger end |
#max_subtransactions_depth ⇒ Object
Returns the value of attribute max_subtransactions_depth.
5 6 7 |
# File 'lib/isolator/plugins/database_subtransactions.rb', line 5 def max_subtransactions_depth @max_subtransactions_depth end |
#raise_exceptions ⇒ Object Also known as: raise_exceptions?
Returns the value of attribute raise_exceptions.
20 21 22 |
# File 'lib/isolator/configuration.rb', line 20 def raise_exceptions @raise_exceptions end |
#send_notifications ⇒ Object Also known as: send_notifications?
Returns the value of attribute send_notifications.
20 21 22 |
# File 'lib/isolator/configuration.rb', line 20 def send_notifications @send_notifications end |
Instance Method Details
#test_env? ⇒ Boolean
34 35 36 |
# File 'lib/isolator/configuration.rb', line 34 def test_env? ENV["RACK_ENV"] == "test" || ENV["RAILS_ENV"] == "test" end |