Class: Nexpose::HTMLForm
- Inherits:
-
Object
- Object
- Nexpose::HTMLForm
- Includes:
- XMLUtils
- Defined in:
- lib/nexpose/creds.rb
Overview
When using htmlform, this represents the login form information.
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
The HTTP action (URL) through which to submit the login form.
-
#enctype ⇒ Object
readonly
The HTTP encoding type with which to submit the form.
-
#fields ⇒ Object
readonly
The fields in the HTML Form.
-
#method ⇒ Object
readonly
The HTTP request method with which to submit the form.
-
#name ⇒ Object
readonly
The name of the form being submitted.
Instance Method Summary collapse
- #add_field(field) ⇒ Object
- #as_xml ⇒ Object (also: #to_xml_elem)
-
#initialize(name, action, method, enctype) ⇒ HTMLForm
constructor
A new instance of HTMLForm.
Methods included from XMLUtils
Constructor Details
#initialize(name, action, method, enctype) ⇒ HTMLForm
Returns a new instance of HTMLForm.
318 319 320 321 322 323 324 |
# File 'lib/nexpose/creds.rb', line 318 def initialize(name, action, method, enctype) @name = name @action = action @method = method @enctype = enctype @fields = [] end |
Instance Attribute Details
#action ⇒ Object (readonly)
The HTTP action (URL) through which to submit the login form.
310 311 312 |
# File 'lib/nexpose/creds.rb', line 310 def action @action end |
#enctype ⇒ Object (readonly)
The HTTP encoding type with which to submit the form.
314 315 316 |
# File 'lib/nexpose/creds.rb', line 314 def enctype @enctype end |
#fields ⇒ Object (readonly)
The fields in the HTML Form
316 317 318 |
# File 'lib/nexpose/creds.rb', line 316 def fields @fields end |
#method ⇒ Object (readonly)
The HTTP request method with which to submit the form.
312 313 314 |
# File 'lib/nexpose/creds.rb', line 312 def method @method end |
#name ⇒ Object (readonly)
The name of the form being submitted.
308 309 310 |
# File 'lib/nexpose/creds.rb', line 308 def name @name end |
Instance Method Details
#add_field(field) ⇒ Object
326 327 328 |
# File 'lib/nexpose/creds.rb', line 326 def add_field(field) @fields << field end |
#as_xml ⇒ Object Also known as: to_xml_elem
330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/nexpose/creds.rb', line 330 def as_xml attributes = {} attributes['name'] = @name attributes['action'] = @action attributes['method'] = @method attributes['enctype'] = @enctype xml = make_xml('HTMLForm', attributes) fields.each() do |field| xml.add_element(field.to_xml_elem) end xml end |