Class: SSHScan::Policy

Inherits:
Object
  • Object
show all
Defined in:
lib/ssh_scan/policy.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Policy

Returns a new instance of Policy.



7
8
9
10
11
12
13
# File 'lib/ssh_scan/policy.rb', line 7

def initialize(opts = {})
  @name = opts['name'] || []
  @kex = opts['kex'] || []
  @macs = opts['macs'] || []
  @encryption = opts['encryption'] || []
  @compression = opts['compression'] || []
end

Instance Attribute Details

#compressionObject (readonly)

Returns the value of attribute compression.



5
6
7
# File 'lib/ssh_scan/policy.rb', line 5

def compression
  @compression
end

#encryptionObject (readonly)

Returns the value of attribute encryption.



5
6
7
# File 'lib/ssh_scan/policy.rb', line 5

def encryption
  @encryption
end

#kexObject (readonly)

Returns the value of attribute kex.



5
6
7
# File 'lib/ssh_scan/policy.rb', line 5

def kex
  @kex
end

#macsObject (readonly)

Returns the value of attribute macs.



5
6
7
# File 'lib/ssh_scan/policy.rb', line 5

def macs
  @macs
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/ssh_scan/policy.rb', line 5

def name
  @name
end

Class Method Details

.from_file(file) ⇒ Object



15
16
17
18
# File 'lib/ssh_scan/policy.rb', line 15

def self.from_file(file)
  opts = YAML.load_file(file)
  self.new(opts)
end

.from_string(string) ⇒ Object



20
21
22
23
# File 'lib/ssh_scan/policy.rb', line 20

def self.from_string(string)
  opts = YAML.load(string)
  self.new(opts)
end