Module: AuthlogicRpx::MethodSet_InternalMapping

Defined in:
lib/authlogic_rpx/acts_as_authentic.rb

Overview

Mix-in collection of methods that are specific to internal 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



277
278
279
# File 'lib/authlogic_rpx/acts_as_authentic.rb', line 277

def add_rpx_identifier( rpx_id, rpx_provider_name )
self.rpx_identifiers.build(:identifier => rpx_id, :provider_name => rpx_provider_name )
end

#identified_by?(id) ⇒ Boolean

Checks if given identifier is an identity for this account

Returns:

  • (Boolean)


283
284
285
# File 'lib/authlogic_rpx/acts_as_authentic.rb', line 283

def identified_by?( id )
	self.rpx_identifiers.find_by_identifier( id )
end

#merge_user_id(from_user) ⇒ Object

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



289
290
291
292
# File 'lib/authlogic_rpx/acts_as_authentic.rb', line 289

def merge_user_id( from_user )
	self.rpx_identifiers << from_user.rpx_identifiers	
	from_user.reload
end

#using_rpx?Boolean

test if account it using RPX authentication

Returns:

  • (Boolean)


270
271
272
# File 'lib/authlogic_rpx/acts_as_authentic.rb', line 270

def using_rpx?
  !rpx_identifiers.empty?
end