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
-
#initialize(name, action, method, enctype) ⇒ HTMLForm
constructor
A new instance of HTMLForm.
- #to_xml_elem ⇒ Object
Methods included from XMLUtils
Constructor Details
#initialize(name, action, method, enctype) ⇒ HTMLForm
Returns a new instance of HTMLForm.
218 219 220 221 222 223 224 |
# File 'lib/nexpose/creds.rb', line 218 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.
210 211 212 |
# File 'lib/nexpose/creds.rb', line 210 def action @action end |
#enctype ⇒ Object (readonly)
The HTTP encoding type with which to submit the form.
214 215 216 |
# File 'lib/nexpose/creds.rb', line 214 def enctype @enctype end |
#fields ⇒ Object (readonly)
The fields in the HTML Form
216 217 218 |
# File 'lib/nexpose/creds.rb', line 216 def fields @fields end |
#method ⇒ Object (readonly)
The HTTP request method with which to submit the form.
212 213 214 |
# File 'lib/nexpose/creds.rb', line 212 def method @method end |
#name ⇒ Object (readonly)
The name of the form being submitted.
208 209 210 |
# File 'lib/nexpose/creds.rb', line 208 def name @name end |
Instance Method Details
#add_field(field) ⇒ Object
226 227 228 |
# File 'lib/nexpose/creds.rb', line 226 def add_field(field) @fields << field end |
#to_xml_elem ⇒ Object
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/nexpose/creds.rb', line 230 def to_xml_elem 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 |