Class: SSHScan::Policy
- Inherits:
-
Object
- Object
- SSHScan::Policy
- Defined in:
- lib/ssh_scan/policy.rb
Instance Attribute Summary collapse
-
#compression ⇒ Object
readonly
Returns the value of attribute compression.
-
#encryption ⇒ Object
readonly
Returns the value of attribute encryption.
-
#kex ⇒ Object
readonly
Returns the value of attribute kex.
-
#macs ⇒ Object
readonly
Returns the value of attribute macs.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Policy
constructor
A new instance of Policy.
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
#compression ⇒ Object (readonly)
Returns the value of attribute compression.
5 6 7 |
# File 'lib/ssh_scan/policy.rb', line 5 def compression @compression end |
#encryption ⇒ Object (readonly)
Returns the value of attribute encryption.
5 6 7 |
# File 'lib/ssh_scan/policy.rb', line 5 def encryption @encryption end |
#kex ⇒ Object (readonly)
Returns the value of attribute kex.
5 6 7 |
# File 'lib/ssh_scan/policy.rb', line 5 def kex @kex end |
#macs ⇒ Object (readonly)
Returns the value of attribute macs.
5 6 7 |
# File 'lib/ssh_scan/policy.rb', line 5 def macs @macs end |
#name ⇒ Object (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 |