lib/loquor/configuration.rb in loquor-1.4.0 vs lib/loquor/configuration.rb in loquor-1.5.0

- old
+ new

@@ -5,19 +5,20 @@ end class Configuration SETTINGS = [ - :logger, :access_id, :secret_key, :endpoint, :substitute_values + :logger, :access_id, :secret_key, :endpoint, :substitute_values, :retry_404s ] attr_writer *SETTINGS attr_accessor :cache def initialize self.logger = Filum.logger self.substitute_values = {} + self.retry_404s = false end SETTINGS.each do |setting| define_method setting do get_or_raise(setting) @@ -25,11 +26,12 @@ end private def get_or_raise(setting) - instance_variable_get("@#{setting.to_s}") || - raise(LoquorConfigurationError.new("Configuration for #{setting} is not set")) + val = instance_variable_get("@#{setting.to_s}") + raise(LoquorConfigurationError.new("Configuration for #{setting} is not set")) if val.nil? + val end end end