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



21
22
23
24
# File 'lib/nexpose/web_credentials.rb', line 21

def initialize(name, value)
  @name = name
  @value = value
end

Instance Attribute Details

#nameObject (readonly)

Name, one per Header



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

def name
  @name
end

#valueObject (readonly)

Value, one per Header



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

def value
  @value
end

Instance Method Details

#to_hObject



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

def to_h
  header = Hash.new
  header[@name] = @value
  header
end

#to_jsonObject



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

def to_json
  JSON.generate(to_h)
end