lib/figaro/env.rb in figaro-0.6.3 vs lib/figaro/env.rb in figaro-0.6.4
- old
+ new
@@ -3,13 +3,14 @@
def self.from(hash)
new.replace(hash)
end
def method_missing(method, *)
- ENV.fetch(method.to_s.upcase) { super }
+ pair = ENV.detect { |k, _| k.upcase == method.to_s.upcase }
+ pair ? pair[1] : super
end
- def respond_to?(method)
- ENV.key?(method.to_s.upcase)
+ def respond_to?(method, *)
+ ENV.keys.any? { |k| k.upcase == method.to_s.upcase } || super
end
end
end