2014-10-17 18:39:53 +00:00
|
|
|
module Msf::Module::Ranking
|
2014-10-16 19:39:33 +00:00
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
module ClassMethods
|
|
|
|
#
|
|
|
|
# Returns this module's ranking.
|
|
|
|
#
|
|
|
|
def rank
|
2014-10-17 18:58:57 +00:00
|
|
|
(const_defined?('Rank')) ? const_get('Rank') : Msf::NormalRanking
|
2014-10-16 19:39:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Returns this module's ranking as a string for display.
|
|
|
|
#
|
|
|
|
def rank_to_h
|
|
|
|
rank_to_s.gsub('Rank', '').downcase
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Returns this module's ranking as a string representation.
|
|
|
|
#
|
|
|
|
def rank_to_s
|
2014-10-17 18:43:51 +00:00
|
|
|
Msf::RankingName[rank]
|
2014-10-16 19:39:33 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Instance Methods
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the module's rank.
|
|
|
|
#
|
|
|
|
def rank
|
|
|
|
self.class.rank
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the module's rank in display format.
|
|
|
|
#
|
|
|
|
def rank_to_h
|
|
|
|
self.class.rank_to_h
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the module's rank in string format.
|
|
|
|
#
|
|
|
|
def rank_to_s
|
|
|
|
self.class.rank_to_s
|
|
|
|
end
|
|
|
|
end
|