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

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

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ FrozenConfiguration

Returns a new instance of FrozenConfiguration.



262
263
264
265
266
267
268
# File 'lib/wcc/contentful/configuration.rb', line 262

def initialize(configuration)
  ATTRIBUTES.each do |att|
    val = configuration.public_send(att)
    val = val.dup.freeze if val.is_a?(Hash) || val.is_a?(Array)
    instance_variable_set("@#{att}", val)
  end
end

Instance Method Details

#frozen?Boolean

Returns:

  • (Boolean)


275
276
277
# File 'lib/wcc/contentful/configuration.rb', line 275

def frozen?
  true
end

#master?Boolean

Returns true if the currently configured environment is pointing at ‘master`.

Returns:

  • (Boolean)


271
272
273
# File 'lib/wcc/contentful/configuration.rb', line 271

def master?
  !environment.present?
end