From e4296932942f5056665cdbe178eb10382c9baa33 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Tue, 19 Jul 2016 13:59:12 -0700 Subject: [PATCH] Forward #each on Rails::Auth::Credentials and make it Enumerable It's useful to be able to enumerate credentials --- lib/rails/auth/credentials.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rails/auth/credentials.rb b/lib/rails/auth/credentials.rb index 47ff478..1d45184 100644 --- a/lib/rails/auth/credentials.rb +++ b/lib/rails/auth/credentials.rb @@ -8,8 +8,9 @@ module Auth # Stores a set of credentials class Credentials extend Forwardable + include Enumerable - def_delegators :@credentials, :[], :fetch, :empty?, :key?, :to_hash + def_delegators :@credentials, :[], :fetch, :empty?, :key?, :each, :to_hash def self.from_rack_env(env) new(env.fetch(Rails::Auth::Env::CREDENTIALS_ENV_KEY, {}))