Class: StandardId::ScopeConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/standard_id/scope_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pathObject (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
end

#allow_registrationObject (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

#labelObject (readonly)

Returns the value of attribute label.



5
6
7
# File 'lib/standard_id/scope_config.rb', line 5

def label
  @label
end

#nameObject (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_messageObject (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
  @no_profile_message
end

#profile_typeObject (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

Returns:

  • (Boolean)


16
17
18
# File 'lib/standard_id/scope_config.rb', line 16

def requires_profile?
  profile_type.present?
end