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.
-
#scopes ⇒ Object
readonly
Returns the value of attribute scopes.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Claim
constructor
A new instance of Claim.
- #scope ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Claim
Returns a new instance of Claim.
22 23 24 25 26 27 28 29 |
# File 'lib/doorkeeper/openid_connect/claims/claim.rb', line 22 def initialize( = {}) @name = [:name].to_sym @response = Array.wrap([:response]).freeze @scopes = normalize_scopes([:scope]) # use default scope for Standard Claims, fallback to profile @scopes = [default_scope].freeze if @scopes.empty? 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 |
#scopes ⇒ Object (readonly)
Returns the value of attribute scopes.
8 9 10 |
# File 'lib/doorkeeper/openid_connect/claims/claim.rb', line 8 def scopes @scopes end |
Instance Method Details
#scope ⇒ Object
31 32 33 |
# File 'lib/doorkeeper/openid_connect/claims/claim.rb', line 31 def scope @scopes.first end |