class Ravelin::AuthenticationMechanisms::Social

Constants

FAILURE_REASONS
PROVIDERS

Attributes

failure_reason[RW]
social_provider[RW]
success[RW]

Public Instance Methods

failure_reason=(reason) click to toggle source
# File lib/ravelin/authentication_mechanisms/social.rb, line 14
def failure_reason=(reason)
  @failure_reason = reason.to_s.upcase
end
social_provider=(provider) click to toggle source
# File lib/ravelin/authentication_mechanisms/social.rb, line 10
def social_provider=(provider)
  @social_provider = provider.to_s.downcase
end
validate() click to toggle source
Calls superclass method
# File lib/ravelin/authentication_mechanisms/social.rb, line 18
def validate
  super

  if !success && !FAILURE_REASONS.include?(failure_reason)
    raise ArgumentError.new("Failure reason value must be one of #{FAILURE_REASONS.join(', ')}")
  end

  if !PROVIDERS.include?(social_provider)
    raise ArgumentError.new("Social provider value must be one of #{PROVIDERS.join(', ')}")
  end
end