Class: Devise::JWT::DefaultsGenerator
- Inherits:
-
Object
- Object
- Devise::JWT::DefaultsGenerator
- Defined in:
- lib/devise/jwt/defaults_generator.rb
Overview
Generate defaults to be used in the configuration for the Devise installation in a Rails app
Instance Attribute Summary collapse
-
#defaults ⇒ Object
readonly
Returns the value of attribute defaults.
-
#devise_mappings ⇒ Object
readonly
Returns the value of attribute devise_mappings.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize ⇒ DefaultsGenerator
constructor
A new instance of DefaultsGenerator.
Constructor Details
#initialize ⇒ DefaultsGenerator
Returns a new instance of DefaultsGenerator.
16 17 18 19 20 21 22 23 24 |
# File 'lib/devise/jwt/defaults_generator.rb', line 16 def initialize @devise_mappings = Devise.mappings @defaults = { mappings: {}, revocation_strategies: {}, dispatch_requests: [], revocation_requests: [] } end |
Instance Attribute Details
#defaults ⇒ Object (readonly)
Returns the value of attribute defaults.
10 11 12 |
# File 'lib/devise/jwt/defaults_generator.rb', line 10 def defaults @defaults end |
#devise_mappings ⇒ Object (readonly)
Returns the value of attribute devise_mappings.
10 11 12 |
# File 'lib/devise/jwt/defaults_generator.rb', line 10 def devise_mappings @devise_mappings end |
Class Method Details
.call ⇒ Object
12 13 14 |
# File 'lib/devise/jwt/defaults_generator.rb', line 12 def self.call new.call end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/devise/jwt/defaults_generator.rb', line 26 def call devise_mappings.each_key do |scope| inspector = MappingInspector.new(scope) next unless inspector.jwt? add_defaults(inspector) end defaults end |