Class: Ncrack::XML::Credentials
- Inherits:
-
Object
- Object
- Ncrack::XML::Credentials
- Defined in:
- lib/ncrack/xml/credentials.rb
Overview
Represents a credentials
XML element.
Instance Method Summary collapse
-
#initialize(node) ⇒ Credentials
constructor
private
Initializes the credentials object.
-
#password ⇒ String
The successfully bruteforced password.
-
#to_a ⇒ (String, String)
Converts the credentials to a String.
-
#to_s ⇒ String
Converts the credentials to a String.
-
#username ⇒ String
(also: #user_name)
The successfully bruteforced username.
Constructor Details
#initialize(node) ⇒ Credentials
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes the credentials object.
16 17 18 |
# File 'lib/ncrack/xml/credentials.rb', line 16 def initialize(node) @node = node end |
Instance Method Details
#password ⇒ String
The successfully bruteforced password.
38 39 40 |
# File 'lib/ncrack/xml/credentials.rb', line 38 def password @password ||= @node['password'] end |
#to_a ⇒ (String, String)
Converts the credentials to a String.
58 59 60 |
# File 'lib/ncrack/xml/credentials.rb', line 58 def to_a [username, password] end |
#to_s ⇒ String
Converts the credentials to a String.
48 49 50 |
# File 'lib/ncrack/xml/credentials.rb', line 48 def to_s "#{username}:#{password}" end |
#username ⇒ String Also known as: user_name
The successfully bruteforced username.
26 27 28 |
# File 'lib/ncrack/xml/credentials.rb', line 26 def username @username ||= @node['username'] end |