Class: Nexpose::Field
Overview
When using htmlform, 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_xml_elem ⇒ Object
Methods included from XMLUtils
Constructor Details
#initialize(name, value, type, dynamic, checked) ⇒ Field
Returns a new instance of Field.
184 185 186 187 188 189 190 |
# File 'lib/nexpose/creds.rb', line 184 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).
182 183 184 |
# File 'lib/nexpose/creds.rb', line 182 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.
179 180 181 |
# File 'lib/nexpose/creds.rb', line 179 def dynamic @dynamic end |
#name ⇒ Object (readonly)
The name of the HTML field (form parameter).
171 172 173 |
# File 'lib/nexpose/creds.rb', line 171 def name @name end |
#type ⇒ Object (readonly)
The type of the HTML field (form parameter).
175 176 177 |
# File 'lib/nexpose/creds.rb', line 175 def type @type end |
#value ⇒ Object (readonly)
The value of the HTML field (form parameter).
173 174 175 |
# File 'lib/nexpose/creds.rb', line 173 def value @value end |
Instance Method Details
#to_xml_elem ⇒ Object
192 193 194 195 196 197 198 199 200 201 |
# File 'lib/nexpose/creds.rb', line 192 def to_xml_elem attributes = {} attributes['name'] = @name attributes['value'] = @value attributes['type'] = @type attributes['dynamic'] = @dynamic attributes['checked'] = @checked make_xml('Field', attributes) end |