Class: Chronos::Configuration::Snapshot

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

Overview

Immutable configuration shared by all runtime components.

Instance Method Summary collapse

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

Returns:

  • (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