Class: StandardId::ScopeConfig
- Inherits:
-
Object
- Object
- StandardId::ScopeConfig
- Defined in:
- lib/standard_id/scope_config.rb
Instance Attribute Summary collapse
-
#after_sign_in_path ⇒ Object
readonly
Returns the value of attribute after_sign_in_path.
-
#allow_registration ⇒ Object
readonly
Returns the value of attribute allow_registration.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#no_profile_message ⇒ Object
readonly
Returns the value of attribute no_profile_message.
-
#profile_type ⇒ Object
readonly
Returns the value of attribute profile_type.
Instance Method Summary collapse
-
#initialize(name, config = {}) ⇒ ScopeConfig
constructor
A new instance of ScopeConfig.
- #requires_profile? ⇒ Boolean
Constructor Details
#initialize(name, config = {}) ⇒ ScopeConfig
Returns a new instance of ScopeConfig.
7 8 9 10 11 12 13 14 |
# File 'lib/standard_id/scope_config.rb', line 7 def initialize(name, config = {}) @name = name.to_sym @profile_type = config[:profile_type] @after_sign_in_path = config[:after_sign_in_path] @no_profile_message = config[:no_profile_message] || "Access denied. No matching profile found." @label = config[:label] || name.to_s.humanize @allow_registration = config.fetch(:allow_registration, true) end |
Instance Attribute Details
#after_sign_in_path ⇒ Object (readonly)
Returns the value of attribute after_sign_in_path.
5 6 7 |
# File 'lib/standard_id/scope_config.rb', line 5 def after_sign_in_path @after_sign_in_path end |
#allow_registration ⇒ Object (readonly)
Returns the value of attribute allow_registration.
5 |
# File 'lib/standard_id/scope_config.rb', line 5 attr_reader :name, :profile_type, :after_sign_in_path, :no_profile_message, :label, :allow_registration |
#label ⇒ Object (readonly)
Returns the value of attribute label.
5 6 7 |
# File 'lib/standard_id/scope_config.rb', line 5 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/standard_id/scope_config.rb', line 5 def name @name end |
#no_profile_message ⇒ Object (readonly)
Returns the value of attribute no_profile_message.
5 6 7 |
# File 'lib/standard_id/scope_config.rb', line 5 def @no_profile_message end |
#profile_type ⇒ Object (readonly)
Returns the value of attribute profile_type.
5 6 7 |
# File 'lib/standard_id/scope_config.rb', line 5 def profile_type @profile_type end |
Instance Method Details
#requires_profile? ⇒ Boolean
16 17 18 |
# File 'lib/standard_id/scope_config.rb', line 16 def requires_profile? profile_type.present? end |