Class: Nexpose::WebCredentials::Header
- Inherits:
-
Object
- Object
- Nexpose::WebCredentials::Header
- Defined in:
- lib/nexpose/web_credentials.rb
Overview
Object that represents Header name-value pairs, associated with Web Session Authentication.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Name, one per Header.
-
#value ⇒ Object
readonly
Value, one per Header.
Instance Method Summary collapse
-
#initialize(name, value) ⇒ Header
constructor
Construct with name value pair.
- #to_h ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(name, value) ⇒ Header
Construct with name value pair
20 21 22 23 |
# File 'lib/nexpose/web_credentials.rb', line 20 def initialize(name, value) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Name, one per Header
15 16 17 |
# File 'lib/nexpose/web_credentials.rb', line 15 def name @name end |
#value ⇒ Object (readonly)
Value, one per Header
17 18 19 |
# File 'lib/nexpose/web_credentials.rb', line 17 def value @value end |
Instance Method Details
#to_h ⇒ Object
29 30 31 32 33 |
# File 'lib/nexpose/web_credentials.rb', line 29 def to_h header = {} header[@name] = @value header end |
#to_json ⇒ Object
25 26 27 |
# File 'lib/nexpose/web_credentials.rb', line 25 def to_json JSON.generate(to_h) end |