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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration, frozen_wcc_contentful_config) ⇒ FrozenConfiguration

Returns a new instance of FrozenConfiguration.



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/wcc/contentful/app/configuration.rb', line 42

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

  @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 Attribute Details

#wcc_contentful_configObject (readonly)

Returns the value of attribute wcc_contentful_config.



38
39
40
# File 'lib/wcc/contentful/app/configuration.rb', line 38

def wcc_contentful_config
  @wcc_contentful_config
end

Instance Method Details

#frozen?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/wcc/contentful/app/configuration.rb', line 56

def frozen?
  true
end