Class: Eventsimple::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/eventsimple/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



12
13
14
15
16
17
18
19
20
# File 'lib/eventsimple/configuration.rb', line 12

def initialize
  @dispatchers = []
  @max_concurrency_retries = 2
  @metadata_klass = 'Eventsimple::Metadata'
  @parent_record_klass = 'ApplicationRecord'
  @retry_reactor_on_record_not_found = false

  @ui_visible_models = [] # internal use only
end

Instance Attribute Details

#max_concurrency_retriesObject

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

#metadata_klassObject



41
42
43
# File 'lib/eventsimple/configuration.rb', line 41

def 
  @metadata_klass_const ||= @metadata_klass.constantize
end

#parent_record_klassObject



45
46
47
# File 'lib/eventsimple/configuration.rb', line 45

def parent_record_klass
  @parent_record_const ||= @parent_record_klass.constantize
end

#retry_reactor_on_record_not_foundObject

Returns the value of attribute retry_reactor_on_record_not_found.



8
9
10
# File 'lib/eventsimple/configuration.rb', line 8

def retry_reactor_on_record_not_found
  @retry_reactor_on_record_not_found
end

#ui_visible_modelsObject

Returns the value of attribute ui_visible_models.



10
11
12
# File 'lib/eventsimple/configuration.rb', line 10

def ui_visible_models
  @ui_visible_models
end

Instance Method Details

#dispatchersObject

rubocop:disable Naming/MemoizedInstanceVariableName



37
38
39
# File 'lib/eventsimple/configuration.rb', line 37

def dispatchers
  @dispatchers_klass_consts ||= @dispatchers.map(&:constantize)
end

#dispatchers=(value) ⇒ Object

Raises:

  • (ArgumentError)


30
31
32
33
34
# File 'lib/eventsimple/configuration.rb', line 30

def dispatchers=(value)
  raise ArgumentError, 'dispatchers must be an array' unless value.is_a?(Array)

  @dispatchers = value
end