Class: WCC::Contentful::App::Configuration::FrozenConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/wcc/contentful/app/configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration, frozen_wcc_contentful_config) ⇒ FrozenConfiguration

Returns a new instance of FrozenConfiguration.

Raises:

  • (ArgumentError)


40
41
42
43
44
45
46
47
48
49
50
# File 'lib/wcc/contentful/app/configuration.rb', line 40

def initialize(configuration, frozen_wcc_contentful_config)
  raise ArgumentError, 'Please first freeze the wcc_contentful_config' unless frozen_wcc_contentful_config.frozen?

  @wcc_contentful_config = frozen_wcc_contentful_config

  ATTRIBUTES.each do |att|
    val = configuration.public_send(att)
    val.freeze if val.respond_to?(:freeze)
    instance_variable_set("@#{att}", val)
  end
end

Instance Method Details

#frozen?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/wcc/contentful/app/configuration.rb', line 52

def frozen?
  true
end