Sha256: 72f6aff123b1defceaa433ff263e85f5a387c6e53b5d244a5839068f8752cc6d

Contents?: true

Size: 955 Bytes

Versions: 11

Compression:

Stored size: 955 Bytes

Contents

require File.dirname(__FILE__) + '/rpxresponse.rb'

module RPXNow

  def self.user_data(token, options={})
    data = get_test_data(token)
    if block_given? then yield(data) else parse_user_data(data) end
  end

  def self.parse_user_data(data)
    data
  end
  
  def self.get_test_data(token)

    response = Rpxresponse.find_by_username(token)    
    if response
      data = {}
      data['profile'] = {}
      data['profile']['identifier'] = response.identifier
      data['profile']['providerName'] = response.provider_name
      data['profile']['preferredUsername'] = response.username
      data['profile']['email'] = response.verified_email
      
      data[:identifier] = data['profile']['identifier']
      data[:providerName] = data['profile']['providerName']
      data[:email] = response.verified_email
      data[:username] = data['profile']['preferredUsername']
      data[:name] = response.display_name
    end
    
    data
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
Empact-authlogic_rpx-2.0.0 test/libs/mock_rpx_now.rb
slayer-authlogic_rpx-1.2.2 test/libs/mock_rpx_now.rb
slayer-authlogic_rpx-1.2.1 test/libs/mock_rpx_now.rb
authlogic_rpx-1.2.0 test/libs/mock_rpx_now.rb
Empact-authlogic_rpx-1.1.8 test/libs/mock_rpx_now.rb
Empact-authlogic_rpx-1.1.7 test/libs/mock_rpx_now.rb
Empact-authlogic_rpx-1.1.6 test/libs/mock_rpx_now.rb
Empact-authlogic_rpx-1.1.5 test/libs/mock_rpx_now.rb
Empact-authlogic_rpx-1.1.4 test/libs/mock_rpx_now.rb
Empact-authlogic_rpx-1.1.3 test/libs/mock_rpx_now.rb
Empact-authlogic_rpx-1.1.2 test/libs/mock_rpx_now.rb