Class: Nexpose::Field
- Inherits:
-
Object
- Object
- Nexpose::Field
- Includes:
- XMLUtils
- Defined in:
- lib/nexpose/site_credential.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
- #as_xml ⇒ Object (also: #to_xml_elem)
-
#initialize(name, value, type, dynamic, checked) ⇒ Field
constructor
A new instance of Field.
Methods included from XMLUtils
#make_xml, #parse_xml, success?
Constructor Details
#initialize(name, value, type, dynamic, checked) ⇒ Field
Returns a new instance of Field.
211 212 213 214 215 216 217 |
# File 'lib/nexpose/site_credential.rb', line 211 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).
209 210 211 |
# File 'lib/nexpose/site_credential.rb', line 209 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.
206 207 208 |
# File 'lib/nexpose/site_credential.rb', line 206 def dynamic @dynamic end |
#name ⇒ Object (readonly)
The name of the HTML field (form parameter).
198 199 200 |
# File 'lib/nexpose/site_credential.rb', line 198 def name @name end |
#type ⇒ Object (readonly)
The type of the HTML field (form parameter).
202 203 204 |
# File 'lib/nexpose/site_credential.rb', line 202 def type @type end |
#value ⇒ Object (readonly)
The value of the HTML field (form parameter).
200 201 202 |
# File 'lib/nexpose/site_credential.rb', line 200 def value @value end |
Instance Method Details
#as_xml ⇒ Object Also known as: to_xml_elem
219 220 221 222 223 224 225 226 227 228 |
# File 'lib/nexpose/site_credential.rb', line 219 def as_xml attributes = {} attributes['name'] = @name attributes['value'] = @value attributes['type'] = @type attributes['dynamic'] = @dynamic attributes['checked'] = @checked make_xml('Field', attributes) end |