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.
265 266 267 268 269 270 271 272 |
# File 'lib/chronos/configuration.rb', line 265 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
274 275 276 |
# File 'lib/chronos/configuration.rb', line 274 def enabled_for_environment? enabled && !ignored_environments.map(&:to_s).include?(environment.to_s) end |