Class: SSHScan::Attribute

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

Overview

A class for making attribute comparison possible beyond simple string comparison

Instance Method Summary collapse

Constructor Details

#initialize(attribute_string) ⇒ Attribute

Returns a new instance of Attribute.



11
12
13
# File 'lib/ssh_scan/attribute.rb', line 11

def initialize(attribute_string)
  @attribute_string = attribute_string
end

Instance Method Details

#==(other) ⇒ Object



23
24
25
# File 'lib/ssh_scan/attribute.rb', line 23

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

#baseObject



19
20
21
# File 'lib/ssh_scan/attribute.rb', line 19

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

#to_sObject



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

def to_s
  @attribute_string
end