Sha256: 27852150b44e03336cd31c538a1ce0020ab9501adfb6cd886dac7431f8508a28

Contents?: true

Size: 575 Bytes

Versions: 20

Compression:

Stored size: 575 Bytes

Contents

require 'yaml'

module SSHScan
  # A helper to turn array of strings into arrays of attributes for quick comparison
  def self.make_attributes(array)
    array.map {|item| SSHScan::Attribute.new(item)}
  end

  # A class for making attribute comparison possible beyond simple string comparison
  class Attribute
    def initialize(attribute_string)
      @attribute_string = attribute_string
    end

    def to_s
      @attribute_string
    end

    def base
      @attribute_string.split("@").first
    end

    def ==(other)
      self.base == other.base
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ssh_scan-0.0.44 lib/ssh_scan/attribute.rb
ssh_scan-0.0.43 lib/ssh_scan/attribute.rb
ssh_scan-0.0.42 lib/ssh_scan/attribute.rb
ssh_scan-0.0.41 lib/ssh_scan/attribute.rb
ssh_scan-0.0.40 lib/ssh_scan/attribute.rb
ssh_scan-0.0.39 lib/ssh_scan/attribute.rb
ssh_scan-0.0.38 lib/ssh_scan/attribute.rb
ssh_scan-0.0.38.pre lib/ssh_scan/attribute.rb
ssh_scan-0.0.37 lib/ssh_scan/attribute.rb
ssh_scan-0.0.36 lib/ssh_scan/attribute.rb
ssh_scan-0.0.35 lib/ssh_scan/attribute.rb
ssh_scan-0.0.34 lib/ssh_scan/attribute.rb
ssh_scan-0.0.33 lib/ssh_scan/attribute.rb
ssh_scan-0.0.32 lib/ssh_scan/attribute.rb
ssh_scan-0.0.31 lib/ssh_scan/attribute.rb
ssh_scan-0.0.30 lib/ssh_scan/attribute.rb
ssh_scan-0.0.29 lib/ssh_scan/attribute.rb
ssh_scan-0.0.28 lib/ssh_scan/attribute.rb
ssh_scan-0.0.27 lib/ssh_scan/attribute.rb
ssh_scan-0.0.26 lib/ssh_scan/attribute.rb