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.
22 23 24 |
# File 'lib/msf/core/module/reference.rb', line 22 def initialize(in_str) self.str = in_str end |
Instance Attribute Details
#str ⇒ Object
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 they're 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_s ⇒ Object
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 |