Class: Eventsimple::Configuration
- Inherits:
-
Object
- Object
- Eventsimple::Configuration
- Defined in:
- lib/eventsimple/configuration.rb
Instance Attribute Summary collapse
-
#max_concurrency_retries ⇒ Object
Returns the value of attribute max_concurrency_retries.
- #parent_record_klass ⇒ Object
-
#retry_reactor_on_record_not_found ⇒ Object
Returns the value of attribute retry_reactor_on_record_not_found.
-
#ui_visible_model_names ⇒ Object
Returns the value of attribute ui_visible_model_names.
Instance Method Summary collapse
-
#dispatchers ⇒ Object
rubocop:disable Naming/MemoizedInstanceVariableName.
- #dispatchers=(value) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#ui_visible_models ⇒ Object
Returns fresh class objects by constantizing stored names This avoids stale class references after code reload in development.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 16 |
# File 'lib/eventsimple/configuration.rb', line 9 def initialize @dispatchers = [] @max_concurrency_retries = 2 @parent_record_klass = 'ApplicationRecord' @retry_reactor_on_record_not_found = false @ui_visible_model_names = [] # internal use only - stores class names as strings end |
Instance Attribute Details
#max_concurrency_retries ⇒ Object
Returns the value of attribute max_concurrency_retries.
5 6 7 |
# File 'lib/eventsimple/configuration.rb', line 5 def max_concurrency_retries @max_concurrency_retries end |
#parent_record_klass ⇒ Object
43 44 45 |
# File 'lib/eventsimple/configuration.rb', line 43 def parent_record_klass @parent_record_const ||= @parent_record_klass.constantize end |
#retry_reactor_on_record_not_found ⇒ Object
Returns the value of attribute retry_reactor_on_record_not_found.
7 8 9 |
# File 'lib/eventsimple/configuration.rb', line 7 def retry_reactor_on_record_not_found @retry_reactor_on_record_not_found end |
#ui_visible_model_names ⇒ Object
Returns the value of attribute ui_visible_model_names.
7 8 9 |
# File 'lib/eventsimple/configuration.rb', line 7 def ui_visible_model_names @ui_visible_model_names end |
Instance Method Details
#dispatchers ⇒ Object
rubocop:disable Naming/MemoizedInstanceVariableName
39 40 41 |
# File 'lib/eventsimple/configuration.rb', line 39 def dispatchers @dispatchers_klass_consts ||= @dispatchers.map(&:constantize) end |
#dispatchers=(value) ⇒ Object
32 33 34 35 36 |
# File 'lib/eventsimple/configuration.rb', line 32 def dispatchers=(value) raise ArgumentError, 'dispatchers must be an array' unless value.is_a?(Array) @dispatchers = value end |
#ui_visible_models ⇒ Object
Returns fresh class objects by constantizing stored names This avoids stale class references after code reload in development
20 21 22 |
# File 'lib/eventsimple/configuration.rb', line 20 def ui_visible_models @ui_visible_model_names.map(&:constantize) end |