Module: AuthlogicRpx::MethodSet_NoMapping

Defined in:
lib/authlogic_rpx/acts_as_authentic.rb

Overview

Mix-in collection of methods that are specific to no-mapping mode of operation

Instance Method Summary collapse

Instance Method Details

#add_rpx_identifier(rpx_id, rpx_provider_name) ⇒ Object

adds RPX identification to the instance. Abstracts how the RPX identifier is added to allow for multiplicity of underlying implementations



236
237
238
239
# File 'lib/authlogic_rpx/acts_as_authentic.rb', line 236

def add_rpx_identifier( rpx_id, rpx_provider_name )
self.rpx_identifier = rpx_id
#TODO: make rpx_provider_name a std param?
end

#identified_by?(id) ⇒ Boolean

Checks if given identifier is an identity for this account

Returns:

  • (Boolean)


243
244
245
# File 'lib/authlogic_rpx/acts_as_authentic.rb', line 243

def identified_by?( id )
	self.rpx_identifier == id
end

#merge_user_id(from_user) ⇒ Object

merge_user_id is an internal method used to merge the actual RPX identifiers



249
250
251
252
253
254
# File 'lib/authlogic_rpx/acts_as_authentic.rb', line 249

def merge_user_id( from_user )
  self.rpx_identifier = from_user.rpx_identifier
  from_user.rpx_identifier = nil
  from_user.save
  from_user.reload		
end

#rpx_identifiersObject

Add an rpx_identifier collection method



259
260
261
# File 'lib/authlogic_rpx/acts_as_authentic.rb', line 259

def rpx_identifiers
  [{ :identifier => rpx_identifier, :provider_name => "Unknown" }]
end

#using_rpx?Boolean

test if account it using RPX authentication

Returns:

  • (Boolean)


229
230
231
# File 'lib/authlogic_rpx/acts_as_authentic.rb', line 229

def using_rpx?
  !rpx_identifier.blank?
end