lib/ronin/password.rb in ronin-1.3.0 vs lib/ronin/password.rb in ronin-1.4.0.rc1
- old
+ new
@@ -16,11 +16,10 @@
# You should have received a copy of the GNU General Public License
# along with Ronin. If not, see <http://www.gnu.org/licenses/>.
#
require 'ronin/model'
-require 'ronin/credential'
require 'digest'
module Ronin
#
@@ -41,9 +40,26 @@
# The credentials which use the password
has 0..n, :credentials
# The user names which use the password
has 0..n, :user_names, :through => :credentials
+
+ #
+ # Parses a password.
+ #
+ # @param [#to_s] password
+ # The password to parse.
+ #
+ # @return [Password]
+ # The parsed password.
+ #
+ # @since 1.4.0
+ #
+ # @api public
+ #
+ def self.parse(password)
+ first_or_new(:clear_text => password.to_s)
+ end
#
# Hashes the password.
#
# @param [Symbol, String] digest