CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/msf/core/module/ranking.rb
Views: 11784
1
module Msf::Module::Ranking
2
extend ActiveSupport::Concern
3
4
module ClassMethods
5
#
6
# Returns this module's ranking.
7
#
8
def rank
9
(const_defined?('Rank')) ? const_get('Rank') : Msf::NormalRanking
10
end
11
12
#
13
# Returns this module's ranking as a string for display.
14
#
15
def rank_to_h
16
rank_to_s.gsub('Rank', '').downcase
17
end
18
19
#
20
# Returns this module's ranking as a string representation.
21
#
22
def rank_to_s
23
Msf::RankingName[rank]
24
end
25
end
26
27
#
28
# Instance Methods
29
#
30
31
#
32
# Returns the module's rank.
33
#
34
def rank
35
self.class.rank
36
end
37
38
#
39
# Returns the module's rank in display format.
40
#
41
def rank_to_h
42
self.class.rank_to_h
43
end
44
45
#
46
# Returns the module's rank in string format.
47
#
48
def rank_to_s
49
self.class.rank_to_s
50
end
51
end
52
53