Class: Msf::Module::Reference

Inherits:
Object
  • Object
show all
Defined in:
lib/msf/core/module/reference.rb

Overview

A reference to some sort of information. This is typically a URL, but could be any type of referential value that people could use to research a topic.

Direct Known Subclasses

SiteReference

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(in_str) ⇒ Reference

Initializes a reference from a string.


22
23
24
# File 'lib/msf/core/module/reference.rb', line 22

def initialize(in_str)
  self.str = in_str
end

Instance Attribute Details

#strObject

The reference string.


50
51
52
# File 'lib/msf/core/module/reference.rb', line 50

def str
  @str
end

Class Method Details

.from_s(str) ⇒ Object

Serialize a reference from a string.


15
16
17
# File 'lib/msf/core/module/reference.rb', line 15

def self.from_s(str)
  return self.new(str)
end

Instance Method Details

#==(tgt) ⇒ Object

Compares references to see if their equal.


29
30
31
# File 'lib/msf/core/module/reference.rb', line 29

def ==(tgt)
  return (tgt.to_s == to_s)
end

#from_s(in_str) ⇒ Object

Serializes the reference instance from a string.


43
44
45
# File 'lib/msf/core/module/reference.rb', line 43

def from_s(in_str)
  self.str = in_str
end

#to_sObject

Returns the reference as a string.


36
37
38
# File 'lib/msf/core/module/reference.rb', line 36

def to_s
  return self.str
end