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 ], }
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.
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/doorkeeper/openid_connect/claims/claim.rb', line 19 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.
5 6 7 |
# File 'lib/doorkeeper/openid_connect/claims/claim.rb', line 5 def name @name end |
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/doorkeeper/openid_connect/claims/claim.rb', line 5 def response @response end |
#scope ⇒ Object
Returns the value of attribute scope.
5 6 7 |
# File 'lib/doorkeeper/openid_connect/claims/claim.rb', line 5 def scope @scope end |