Class: Nexpose::WebCredentials::Field
- Inherits:
-
Object
- Object
- Nexpose::WebCredentials::Field
- Defined in:
- lib/nexpose/web_credentials.rb
Overview
When using HTML form, this represents the login form information.
Instance Attribute Summary collapse
-
#checked ⇒ Object
readonly
If the HTML field (form parameter) is a radio button, checkbox or select field, this flag determines if the field should be checked (selected).
-
#dynamic ⇒ Object
readonly
Is the HTML field (form parameter) dynamically generated? If so, the login page is requested and the value of the field is extracted from the response.
-
#name ⇒ Object
readonly
The name of the HTML field (form parameter).
-
#type ⇒ Object
readonly
The type of the HTML field (form parameter).
-
#value ⇒ Object
readonly
The value of the HTML field (form parameter).
Instance Method Summary collapse
-
#initialize(name, value, type, dynamic, checked) ⇒ Field
constructor
A new instance of Field.
- #to_h ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(name, value, type, dynamic, checked) ⇒ Field
Returns a new instance of Field.
118 119 120 121 122 123 124 |
# File 'lib/nexpose/web_credentials.rb', line 118 def initialize(name, value, type, dynamic, checked) @name = name @value = value @type = type @dynamic = dynamic @checked = checked end |
Instance Attribute Details
#checked ⇒ Object (readonly)
If the HTML field (form parameter) is a radio button, checkbox or select field, this flag determines if the field should be checked (selected).
116 117 118 |
# File 'lib/nexpose/web_credentials.rb', line 116 def checked @checked end |
#dynamic ⇒ Object (readonly)
Is the HTML field (form parameter) dynamically generated? If so, the login page is requested and the value of the field is extracted from the response.
113 114 115 |
# File 'lib/nexpose/web_credentials.rb', line 113 def dynamic @dynamic end |
#name ⇒ Object (readonly)
The name of the HTML field (form parameter).
105 106 107 |
# File 'lib/nexpose/web_credentials.rb', line 105 def name @name end |
#type ⇒ Object (readonly)
The type of the HTML field (form parameter).
109 110 111 |
# File 'lib/nexpose/web_credentials.rb', line 109 def type @type end |
#value ⇒ Object (readonly)
The value of the HTML field (form parameter).
107 108 109 |
# File 'lib/nexpose/web_credentials.rb', line 107 def value @value end |
Instance Method Details
#to_h ⇒ Object
130 131 132 133 134 135 136 137 138 |
# File 'lib/nexpose/web_credentials.rb', line 130 def to_h { value: value, type: type, name: name, dynamic: dynamic, checked: checked } end |
#to_json ⇒ Object
126 127 128 |
# File 'lib/nexpose/web_credentials.rb', line 126 def to_json JSON.generate(to_h) end |