Class: Chronos::Configuration::Snapshot
- Inherits:
-
Object
- Object
- Chronos::Configuration::Snapshot
- Defined in:
- lib/chronos/configuration.rb
Overview
Immutable configuration shared by all runtime components.
Instance Method Summary collapse
- #enabled_for_environment? ⇒ Boolean
-
#initialize(values) ⇒ Snapshot
constructor
A new instance of Snapshot.
Constructor Details
#initialize(values) ⇒ Snapshot
Returns a new instance of Snapshot.
285 286 287 288 289 290 291 292 |
# File 'lib/chronos/configuration.rb', line 285 def initialize(values) ATTRIBUTES.each do |attribute| value = values[attribute] deep_freeze(value) instance_variable_set("@#{attribute}", value) end freeze end |
Instance Method Details
#enabled_for_environment? ⇒ Boolean
294 295 296 |
# File 'lib/chronos/configuration.rb', line 294 def enabled_for_environment? enabled && !ignored_environments.map(&:to_s).include?(environment.to_s) end |