Module: Ronin::Model::HasDefaultPort

Included in:
Exploits::RemoteTCP, Exploits::RemoteUDP
Defined in:
lib/ronin/model/has_default_port.rb

Overview

Adds a default_port property to a model which receives it's default value from a DEFAULT_PORT constant.

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object


32
33
34
35
36
37
38
39
40
41
# File 'lib/ronin/model/has_default_port.rb', line 32

def self.included(base)
  base.module_eval do
    # Default port to use
    property :default_port, Integer, default: proc { |resource,port|
      if resource.class.const_defined?('DEFAULT_PORT')
        resource.class.const_get('DEFAULT_PORT')
      end
    }
  end
end