Module: Stenotype::Configuration
- Extended by:
- Directive
- Defined in:
- lib/stenotype/configuration.rb
Overview
A module containing freshly-event gem configuration
Instance Attribute Summary collapse
-
#auto_adapter_initialization ⇒ true, false
Enables/disables lazy initialization of adapters' clients.
-
#dispatcher ⇒ #publish
As object responding to method [#publish].
-
#enabled ⇒ true, false
A flag indicating whether event emission is enabled.
-
#google_cloud ⇒ NestedConfiguration
Google cloud configuration.
-
#google_cloud.async ⇒ true, false
GC publish mode, either async if true, sync if false.
-
#google_cloud.credentials ⇒ String
A string with GC API credential.
-
#google_cloud.project_id ⇒ String
A name of the project in GC PubSub.
-
#google_cloud.topic ⇒ String
A name of the topic in GC PubSub.
-
#graceful_error_handling ⇒ true, false
A flag for suppressing error raised withing the gem.
-
#logger ⇒ Logger
writeonly
A logger with default severity methods to output gem level messages.
-
#rails ⇒ NestedConfiguration
Rails configuration.
-
#rails.enable_action_controller_ext ⇒ true, false
A flag of whether ActionController ext is enabled.
-
#rails.enable_active_job_ext ⇒ true, false
A flag of whether ActiveJob ext is enabled.
-
#targets ⇒ Array<#publish>
writeonly
A list of targets responding to method [#publish].
-
#uuid_generator ⇒ #uuid
An object responding to method [#uuid].
Class Method Summary collapse
-
.logger ⇒ {Logger, CustomLogger}
A logger object.
-
.targets ⇒ Array<#publish>
An array of targets implementing method [#publish].
Instance Attribute Details
#auto_adapter_initialization ⇒ true, false
Returns enables/disables lazy initialization of adapters' clients.
|
# File 'lib/stenotype/configuration.rb', line 40
|
#dispatcher ⇒ #publish
Returns as object responding to method [#publish].
|
# File 'lib/stenotype/configuration.rb', line 46
|
#enabled ⇒ true, false
Returns a flag indicating whether event emission is enabled.
|
# File 'lib/stenotype/configuration.rb', line 37
|
#google_cloud ⇒ NestedConfiguration
Returns google cloud configuration.
|
# File 'lib/stenotype/configuration.rb', line 52
|
#google_cloud.async ⇒ true, false
Returns GC publish mode, either async if true, sync if false.
|
# File 'lib/stenotype/configuration.rb', line 64
|
#google_cloud.credentials ⇒ String
Returns a string with GC API credential. Refer to GC PubSub documentation.
|
# File 'lib/stenotype/configuration.rb', line 55
|
#google_cloud.project_id ⇒ String
Returns a name of the project in GC PubSub.
|
# File 'lib/stenotype/configuration.rb', line 58
|
#google_cloud.topic ⇒ String
Returns a name of the topic in GC PubSub.
|
# File 'lib/stenotype/configuration.rb', line 61
|
#graceful_error_handling ⇒ true, false
Returns a flag for suppressing error raised withing the gem.
|
# File 'lib/stenotype/configuration.rb', line 31
|
#logger=(value) ⇒ Logger
Returns a logger with default severity methods to output gem level messages.
|
# File 'lib/stenotype/configuration.rb', line 34
|
#rails ⇒ NestedConfiguration
Returns Rails configuration.
|
# File 'lib/stenotype/configuration.rb', line 67
|
#rails.enable_action_controller_ext ⇒ true, false
Returns A flag of whether ActionController ext is enabled.
|
# File 'lib/stenotype/configuration.rb', line 70
|
#rails.enable_active_job_ext ⇒ true, false
Returns A flag of whether ActiveJob ext is enabled.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/stenotype/configuration.rb', line 76 do option :graceful_error_handling, default: true option :enabled, default: true option :targets, default: [] option :dispatcher, default: Stenotype::Dispatcher option :uuid_generator, default: SecureRandom option :logger nested :google_cloud do option :credentials, default: nil option :project_id, default: nil option :topic, default: nil option :async, default: true end nested :rails do option :enable_action_controller_ext, default: true option :enable_active_job_ext, default: true option :auto_adapter_initialization, default: false end end |
#targets=(value) ⇒ Array<#publish>
Returns a list of targets responding to method [#publish].
|
# File 'lib/stenotype/configuration.rb', line 43
|
#uuid_generator ⇒ #uuid
Returns an object responding to method [#uuid].
|
# File 'lib/stenotype/configuration.rb', line 49
|
Class Method Details
.logger ⇒ {Logger, CustomLogger}
Returns a logger object. Logger.new(STDOUT) by default if another is not set during configuration.
116 117 118 119 120 |
# File 'lib/stenotype/configuration.rb', line 116 def logger return config.logger if config.logger config.logger || Logger.new(STDOUT) end |
.targets ⇒ Array<#publish>
THIS NEVER GETS CALLED, needs a fix
Returns An array of targets implementing method [#publish].
138 139 140 141 142 143 144 |
# File 'lib/stenotype/configuration.rb', line 138 def targets return config.targets unless config.targets.empty? raise Stenotype::NoTargetsSpecifiedError, "Please configure a target(s) for events to be sent to. "\ "See #{Stenotype::Configuration} for reference." end |