Class: Msf::Module::Reference
- Inherits:
-
Object
- Object
- Msf::Module::Reference
- 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
Instance Attribute Summary collapse
-
#str ⇒ Object
The reference string.
Class Method Summary collapse
-
.from_s(str) ⇒ Object
Serialize a reference from a string.
Instance Method Summary collapse
-
#==(tgt) ⇒ Object
Compares references to see if they’re equal.
-
#from_s(in_str) ⇒ Object
Serializes the reference instance from a string.
-
#initialize(in_str) ⇒ Reference
constructor
Initializes a reference from a string.
-
#to_s ⇒ Object
Returns the reference as a string.
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
#str ⇒ Object
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_s ⇒ Object
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 |