Class: Nexpose::Field

Inherits:
Object
  • Object
show all
Includes:
XMLUtils
Defined in:
lib/nexpose/creds.rb

Overview

When using htmlform, this represents the login form information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from XMLUtils

#make_xml, #parse_xml

Constructor Details

#initialize(name, value, type, dynamic, checked) ⇒ Field

Returns a new instance of Field.



262
263
264
265
266
267
268
# File 'lib/nexpose/creds.rb', line 262

def initialize(name, value, type, dynamic, checked)
  @name = name
  @value = value
  @type = type
  @dynamic = dynamic
  @checked = checked
end

Instance Attribute Details

#checkedObject (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).



260
261
262
# File 'lib/nexpose/creds.rb', line 260

def checked
  @checked
end

#dynamicObject (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.



257
258
259
# File 'lib/nexpose/creds.rb', line 257

def dynamic
  @dynamic
end

#nameObject (readonly)

The name of the HTML field (form parameter).



249
250
251
# File 'lib/nexpose/creds.rb', line 249

def name
  @name
end

#typeObject (readonly)

The type of the HTML field (form parameter).



253
254
255
# File 'lib/nexpose/creds.rb', line 253

def type
  @type
end

#valueObject (readonly)

The value of the HTML field (form parameter).



251
252
253
# File 'lib/nexpose/creds.rb', line 251

def value
  @value
end

Instance Method Details

#as_xmlObject Also known as: to_xml_elem



270
271
272
273
274
275
276
277
278
279
# File 'lib/nexpose/creds.rb', line 270

def as_xml
  attributes = {}
  attributes['name'] = @name
  attributes['value'] = @value
  attributes['type'] = @type
  attributes['dynamic'] = @dynamic
  attributes['checked'] = @checked

  make_xml('Field', attributes)
end