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.



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

def initialize(in_str)
  self.str = in_str
end

Instance Attribute Details

#strObject

The reference string.



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

def str
  @str
end

Class Method Details

.from_s(str) ⇒ Object

Serialize a reference from a string.



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

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

Instance Method Details

#==(tgt) ⇒ Object

Compares references to see if they’re equal.



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

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

#from_s(in_str) ⇒ Object

Serializes the reference instance from a string.



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

def from_s(in_str)
  self.str = in_str
end

#to_sObject

Returns the reference as a string.



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

def to_s
  return self.str
end