Module: Metasploit::Model::Module::Ancestor::ClassMethods

Defined in:
lib/metasploit/model/module/ancestor.rb

Overview

Defines class methods added to classes that include Metasploit::Model::Module::Ancestor.

Instance Method Summary collapse

Instance Method Details

#handled?(options = {}) ⇒ true, false

Returns whether Metasploit::Model::Module::Ancestor#handler_type is required or must be nil for the given payload_type.

Parameters:

  • options (Hash{Symbol => String,nil}) (defaults to: {})

Options Hash (options):

  • module_type (String, nil) — default: nil

    nil or an element of Metasploit::Model::Module::Ancestor::MODULE_TYPES.

  • payload_type (String, nil) — default: nil

    nil or an element of PAYLOAD_TYPES.

Returns:



160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/metasploit/model/module/ancestor.rb', line 160

def handled?(options={})
  options.assert_valid_keys(:module_type, :payload_type)

  handled = false
  module_type = options[:module_type]
  payload_type = options[:payload_type]

  if module_type == 'payload' and HANDLED_TYPES.include? payload_type
    handled = true
  end

  handled
end