lib/hanami/settings/env_store.rb in hanami-2.0.0.beta3 vs lib/hanami/settings/env_store.rb in hanami-2.0.0.beta4
- old
+ new
@@ -10,21 +10,21 @@
# you subclass `Hanami::App`.
#
# @since 2.0.0
# @api private
class EnvStore
- Undefined = Dry::Core::Constants::Undefined
+ NO_ARG = Object.new.freeze
attr_reader :store, :hanami_env
def initialize(store: ENV, hanami_env: Hanami.env)
@store = store
@hanami_env = hanami_env
end
- def fetch(name, default_value = Undefined, &block)
+ def fetch(name, default_value = NO_ARG, &block)
name = name.to_s.upcase
- args = default_value == Undefined ? [name] : [name, default_value]
+ args = default_value.eql?(NO_ARG) ? [name] : [name, default_value]
store.fetch(*args, &block)
end
end
end