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.



216
217
218
219
220
221
222
# File 'lib/nexpose/creds.rb', line 216

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).



214
215
216
# File 'lib/nexpose/creds.rb', line 214

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.



211
212
213
# File 'lib/nexpose/creds.rb', line 211

def dynamic
  @dynamic
end

#nameObject (readonly)

The name of the HTML field (form parameter).



203
204
205
# File 'lib/nexpose/creds.rb', line 203

def name
  @name
end

#typeObject (readonly)

The type of the HTML field (form parameter).



207
208
209
# File 'lib/nexpose/creds.rb', line 207

def type
  @type
end

#valueObject (readonly)

The value of the HTML field (form parameter).



205
206
207
# File 'lib/nexpose/creds.rb', line 205

def value
  @value
end

Instance Method Details

#to_xml_elemObject



224
225
226
227
228
229
230
231
232
233
# File 'lib/nexpose/creds.rb', line 224

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