Class: Smplkit::Audit::ForwarderEnvironment
- Inherits:
-
Struct
- Object
- Struct
- Smplkit::Audit::ForwarderEnvironment
- Defined in:
- lib/smplkit/audit/models.rb
Overview
Per-environment enablement and optional configuration override for a forwarder.
A forwarder delivers events in a given environment only when that environment has an entry in Smplkit::Audit::Forwarder#environments with enabled: true. An environment with no entry (or enabled: false) receives no deliveries.
Instance Attribute Summary collapse
-
#configuration ⇒ HttpConfiguration?
Optional per-environment destination configuration that fully replaces the forwarder’s base Smplkit::Audit::Forwarder#configuration for this environment.
-
#enabled ⇒ Boolean
Whether the forwarder delivers events in this environment.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(enabled: false, configuration: nil) ⇒ ForwarderEnvironment
constructor
A new instance of ForwarderEnvironment.
Constructor Details
#initialize(enabled: false, configuration: nil) ⇒ ForwarderEnvironment
Returns a new instance of ForwarderEnvironment.
361 362 363 |
# File 'lib/smplkit/audit/models.rb', line 361 def initialize(enabled: false, configuration: nil) super end |
Instance Attribute Details
#configuration ⇒ HttpConfiguration?
Returns Optional per-environment destination configuration that fully replaces the forwarder’s base Smplkit::Audit::Forwarder#configuration for this environment. nil (the default) inherits the base configuration. As with the base configuration, header values are plaintext on writes and returned redacted on reads —re-supply real values before Smplkit::Audit::Forwarder#save.
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
# File 'lib/smplkit/audit/models.rb', line 360 ForwarderEnvironment = Struct.new(:enabled, :configuration, keyword_init: true) do def initialize(enabled: false, configuration: nil) super end def self.from_wire(src) return new if src.nil? cfg = src.configuration new( enabled: src.enabled.nil? ? false : src.enabled, configuration: cfg.nil? ? nil : HttpConfiguration.from_wire(cfg) ) end end |
#enabled ⇒ Boolean
Returns Whether the forwarder delivers events in this environment. Defaults to false.
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
# File 'lib/smplkit/audit/models.rb', line 360 ForwarderEnvironment = Struct.new(:enabled, :configuration, keyword_init: true) do def initialize(enabled: false, configuration: nil) super end def self.from_wire(src) return new if src.nil? cfg = src.configuration new( enabled: src.enabled.nil? ? false : src.enabled, configuration: cfg.nil? ? nil : HttpConfiguration.from_wire(cfg) ) end end |
Class Method Details
.from_wire(src) ⇒ Object
365 366 367 368 369 370 371 372 373 |
# File 'lib/smplkit/audit/models.rb', line 365 def self.from_wire(src) return new if src.nil? cfg = src.configuration new( enabled: src.enabled.nil? ? false : src.enabled, configuration: cfg.nil? ? nil : HttpConfiguration.from_wire(cfg) ) end |