Class: Nexpose::WebCredentials::Field
- Inherits:
-
Object
- Object
- Nexpose::WebCredentials::Field
- Defined in:
- lib/nexpose/web_credentials.rb
Overview
When using HTML form, 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_h ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(name, value, type, dynamic, checked) ⇒ Field
Returns a new instance of Field.
116 117 118 119 120 121 122 |
# File 'lib/nexpose/web_credentials.rb', line 116 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).
114 115 116 |
# File 'lib/nexpose/web_credentials.rb', line 114 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.
111 112 113 |
# File 'lib/nexpose/web_credentials.rb', line 111 def dynamic @dynamic end |
#name ⇒ Object (readonly)
The name of the HTML field (form parameter).
103 104 105 |
# File 'lib/nexpose/web_credentials.rb', line 103 def name @name end |
#type ⇒ Object (readonly)
The type of the HTML field (form parameter).
107 108 109 |
# File 'lib/nexpose/web_credentials.rb', line 107 def type @type end |
#value ⇒ Object (readonly)
The value of the HTML field (form parameter).
105 106 107 |
# File 'lib/nexpose/web_credentials.rb', line 105 def value @value end |
Instance Method Details
#to_h ⇒ Object
128 129 130 131 132 133 134 135 136 |
# File 'lib/nexpose/web_credentials.rb', line 128 def to_h { value: value, type: type, name: name, dynamic: dynamic, checked: checked } end |
#to_json ⇒ Object
124 125 126 |
# File 'lib/nexpose/web_credentials.rb', line 124 def to_json JSON.generate(to_h) end |