Class: Firebase::Auth::IDToken::PublicKeys
- Inherits:
-
Array
- Object
- Array
- Firebase::Auth::IDToken::PublicKeys
- Defined in:
- lib/firebase/auth/id_token/public_keys.rb
Defined Under Namespace
Classes: FailedToFetchFromRemote, NotFound
Instance Method Summary collapse
- #find_by!(kid:) ⇒ Object
-
#initialize ⇒ PublicKeys
constructor
A new instance of PublicKeys.
Constructor Details
#initialize ⇒ PublicKeys
Returns a new instance of PublicKeys.
14 15 16 17 18 |
# File 'lib/firebase/auth/id_token/public_keys.rb', line 14 def initialize public_keys_from_remote.each do |kid, certificate| self << PublicKey.new(kid: kid, certificate: certificate) end end |
Instance Method Details
#find_by!(kid:) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/firebase/auth/id_token/public_keys.rb', line 20 def find_by!(kid:) public_key = self.find { |public_key| public_key.kid == kid } raise NotFound unless public_key public_key end |