Class: Nexpose::WebCredentials::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose/web_credentials.rb

Overview

Object that represents Header name-value pairs, associated with Web Session Authentication.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Name, one per Header



15
16
17
# File 'lib/nexpose/web_credentials.rb', line 15

def name
  @name
end

#valueObject (readonly)

Value, one per Header



17
18
19
# File 'lib/nexpose/web_credentials.rb', line 17

def value
  @value
end

Instance Method Details

#to_hObject



29
30
31
32
33
# File 'lib/nexpose/web_credentials.rb', line 29

def to_h
  header        = {}
  header[@name] = @value
  header
end

#to_jsonObject



25
26
27
# File 'lib/nexpose/web_credentials.rb', line 25

def to_json
  JSON.generate(to_h)
end