Sha256: cadf6a0bf4a3ac218462ff577e65f9474e0d0b26e243cb2b7f3d23e093687580

Contents?: true

Size: 447 Bytes

Versions: 2

Compression:

Stored size: 447 Bytes

Contents

# -*- coding: utf-8 -*-
=begin rdoc
Please see README.rdoc
=end

require 'bcrypt'

module PasswordAttribute

  # Read the :password attribute as a new BCrypt::Password.
  # Return the BCrypt::Password.

  def password
    BCrypt::Password.new(password_before_type_cast)
  end

  # Write the :password attribute as a new BCrypt::Password.

  def password=(plain_text)
    write_attribute(:password,BCrypt::Password.create(plain_text))
  end

end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sixarm_ruby_password_attribute-1.6.0 lib/sixarm_ruby_password_attribute.rb
sixarm_ruby_password_attribute-1.5.8 lib/sixarm_ruby_password_attribute.rb