Module: Ronin::Exploits::Mixins::HasPayload::ClassMethods

Defined in:
lib/ronin/exploits/mixins/has_payload.rb

Overview

Class methods.

Instance Method Summary collapse

Instance Method Details

#payload_class(new_payload_class = nil) ⇒ Class<Ronin::Payloads::Payload>

Gets or sets the payload base class that is compatible with the exploit.

Parameters:

  • new_payload_class (Class<Ronin::Payloads::Payload>, nil) (defaults to: nil)

    The optional new payload base class to set.

Returns:

  • (Class<Ronin::Payloads::Payload>)

    The exploit's compatible payload base class.



74
75
76
77
78
79
80
81
82
83
84
# File 'lib/ronin/exploits/mixins/has_payload.rb', line 74

def payload_class(new_payload_class=nil)
  if new_payload_class
    @payload_class = new_payload_class
  else
    @payload_class ||= if superclass.kind_of?(ClassMethods)
                         superclass.payload_class
                       else
                         Ronin::Payloads::Payload
                       end
  end
end