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.
154 155 156 157 158 159 160 |
# File 'lib/nexpose/web_credentials.rb', line 154 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.
146 147 148 |
# File 'lib/nexpose/web_credentials.rb', line 146 def action @action end |
#encType ⇒ Object (readonly)
The HTTP encoding type with which to submit the form.
150 151 152 |
# File 'lib/nexpose/web_credentials.rb', line 150 def encType @encType end |
#fields ⇒ Object (readonly)
The fields in the HTML Form
152 153 154 |
# File 'lib/nexpose/web_credentials.rb', line 152 def fields @fields end |
#method ⇒ Object (readonly)
The HTTP request method with which to submit the form.
148 149 150 |
# File 'lib/nexpose/web_credentials.rb', line 148 def method @method end |
#name ⇒ Object (readonly)
The name of the form being submitted.
144 145 146 |
# File 'lib/nexpose/web_credentials.rb', line 144 def name @name end |
Instance Method Details
#add_field(field) ⇒ Object
162 163 164 |
# File 'lib/nexpose/web_credentials.rb', line 162 def add_field(field) @fields << field.to_h end |
#to_h ⇒ Object
170 171 172 173 174 175 176 177 |
# File 'lib/nexpose/web_credentials.rb', line 170 def to_h { name: name, action: action, method: method, encType: encType, fields: fields, parentPage: action } end |
#to_json ⇒ Object
166 167 168 |
# File 'lib/nexpose/web_credentials.rb', line 166 def to_json JSON.generate(to_h) end |