Sha256: d0df4e6e398698dc97186bf92fb5eea6e8e20dc0aee6ff7f943fd48ece9531c5

Contents?: true

Size: 719 Bytes

Versions: 3

Compression:

Stored size: 719 Bytes

Contents

require 'yaml'

module SSHScan
  class Policy
    attr_reader :name, :kex, :macs, :encryption, :compression, :references, :auth_methods, :ssh_version

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

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ssh_scan-0.0.16 lib/ssh_scan/policy.rb
ssh_scan-0.0.15 lib/ssh_scan/policy.rb
ssh_scan-0.0.14 lib/ssh_scan/policy.rb