class Ncrack::XML::Credentials
Represents a ‘credentials` XML
element.
Public Class Methods
new(node)
click to toggle source
Initializes the credentials object.
@param [Nokogiri::XML::Node] node
The XML node for the `credentials` XML element.
@api private
# File lib/ncrack/xml/credentials.rb, line 16 def initialize(node) @node = node end
Public Instance Methods
password()
click to toggle source
The successfully bruteforced password.
@return [String]
The value of the `password` attribute.
# File lib/ncrack/xml/credentials.rb, line 38 def password @password ||= @node['password'] end
to_a()
click to toggle source
Converts the credentials to a String.
@return [(String, String)]
Returns a tuple of the {#username} and {#password}.
# File lib/ncrack/xml/credentials.rb, line 58 def to_a [username, password] end
to_s()
click to toggle source
Converts the credentials to a String.
@return [String]
Returns a `"username:password"` String.
# File lib/ncrack/xml/credentials.rb, line 48 def to_s "#{username}:#{password}" end
username()
click to toggle source
The successfully bruteforced username.
@return [String]
The value of the `username` attribute.
# File lib/ncrack/xml/credentials.rb, line 26 def username @username ||= @node['username'] end
Also aliased as: user_name