Class: Nexpose::WebCredentials::HTMLForm
- Inherits:
-
Object
- Object
- Nexpose::WebCredentials::HTMLForm
- Defined in:
- lib/nexpose/web_credentials.rb
Overview
When using HTML form, 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_h ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(name, action, method, encType) ⇒ HTMLForm
Returns a new instance of HTMLForm.
156 157 158 159 160 161 162 |
# File 'lib/nexpose/web_credentials.rb', line 156 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.
148 149 150 |
# File 'lib/nexpose/web_credentials.rb', line 148 def action @action end |
#encType ⇒ Object (readonly)
The HTTP encoding type with which to submit the form.
152 153 154 |
# File 'lib/nexpose/web_credentials.rb', line 152 def encType @encType end |
#fields ⇒ Object (readonly)
The fields in the HTML Form
154 155 156 |
# File 'lib/nexpose/web_credentials.rb', line 154 def fields @fields end |
#method ⇒ Object (readonly)
The HTTP request method with which to submit the form.
150 151 152 |
# File 'lib/nexpose/web_credentials.rb', line 150 def method @method end |
#name ⇒ Object (readonly)
The name of the form being submitted.
146 147 148 |
# File 'lib/nexpose/web_credentials.rb', line 146 def name @name end |
Instance Method Details
#add_field(field) ⇒ Object
164 165 166 |
# File 'lib/nexpose/web_credentials.rb', line 164 def add_field(field) @fields << field.to_h end |
#to_h ⇒ Object
172 173 174 175 176 177 178 179 180 |
# File 'lib/nexpose/web_credentials.rb', line 172 def to_h { name: name, action: action, method: method, encType: encType, fields: fields, parentPage: action } end |
#to_json ⇒ Object
168 169 170 |
# File 'lib/nexpose/web_credentials.rb', line 168 def to_json JSON.generate(to_h) end |