Sha256: 40d8128e610ad48c6f574baf3332aff3bd107d8e49a1f9e14c1189cfa3148c70

Contents?: true

Size: 557 Bytes

Versions: 5

Compression:

Stored size: 557 Bytes

Contents

# encoding: utf-8
module ProxyTester
  class User < ActiveRecord::Base
    #crypt_keeper :password, :encryptor => :aes, :key => ProxyTester.environment.password, salt: 'salt'

    validates :name, presence: true
    validates :password, presence: true

    def self.load_from(source)
      source.create_users(self)
    end

    def to_login(options = {})
      result = []
      result << name

      if options.key? :cleartext
        result << password
      else
        result << '*' * 4
      end

      result.join(':').shellescape
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
proxy_tester-0.1.8 lib/proxy_tester/models/user.rb
proxy_tester-0.1.6 lib/proxy_tester/models/user.rb
proxy_tester-0.1.5 lib/proxy_tester/models/user.rb
proxy_tester-0.1.4 lib/proxy_tester/models/user.rb
proxy_tester-0.1.3 lib/proxy_tester/models/user.rb