lib/ssh_scan/policy.rb in ssh_scan-0.0.25 vs lib/ssh_scan/policy.rb in ssh_scan-0.0.26

- old
+ new

@@ -1,6 +1,7 @@ require 'yaml' +require 'ssh_scan/attribute' module SSHScan # Policy methods that deal with key exchange, macs, encryption methods, # compression methods and more. class Policy @@ -23,9 +24,25 @@ # @return [SSHScan::Policy] new instance with parameters loaded # from YAML file def self.from_file(file) opts = YAML.load_file(file) self.new(opts) + end + + def kex_attributes + SSHScan.make_attributes(@kex) + end + + def mac_attributes + SSHScan.make_attributes(@macs) + end + + def encryption_attributes + SSHScan.make_attributes(@encryption) + end + + def compression_attributes + SSHScan.make_attributes(@compression) end # Generate a {SSHScan::Policy} object from YAML string. # @param string [String] YAML string # @return [SSHScan::Policy] new instance with parameters loaded