Class: Doorkeeper::OpenidConnect::Claims::Claim
- Inherits:
-
Object
- Object
- Doorkeeper::OpenidConnect::Claims::Claim
- Defined in:
- lib/doorkeeper/openid_connect/claims/claim.rb
Direct Known Subclasses
Constant Summary collapse
- STANDARD_CLAIMS =
{ profile: %i[ name family_name given_name middle_name nickname preferred_username profile picture website gender birthdate zoneinfo locale updated_at ], email: %i[email email_verified], address: %i[address], phone: %i[phone_number phone_number_verified], }.freeze
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#response ⇒ Object
Returns the value of attribute response.
-
#scope ⇒ Object
Returns the value of attribute scope.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Claim
constructor
A new instance of Claim.
Constructor Details
#initialize(options = {}) ⇒ Claim
Returns a new instance of Claim.
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/doorkeeper/openid_connect/claims/claim.rb', line 21 def initialize( = {}) @name = [:name].to_sym @response = Array.wrap([:response]) @scope = [:scope].to_sym if [:scope] # use default scope for Standard Claims @scope ||= STANDARD_CLAIMS.find do |_scope, claims| claims.include? @name end.try(:first) # use profile scope as default fallback @scope ||= :profile end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/doorkeeper/openid_connect/claims/claim.rb', line 7 def name @name end |
#response ⇒ Object
Returns the value of attribute response.
7 8 9 |
# File 'lib/doorkeeper/openid_connect/claims/claim.rb', line 7 def response @response end |
#scope ⇒ Object
Returns the value of attribute scope.
7 8 9 |
# File 'lib/doorkeeper/openid_connect/claims/claim.rb', line 7 def scope @scope end |