Module: Ronin::Model::HasDefaultPort
- Included in:
- Exploits::RemoteTCP, Exploits::RemoteUDP
- Defined in:
- lib/ronin/model/has_default_port.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}, &block) ⇒ Object
Creates a new Model.
Class Method Details
.included(base) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/ronin/model/has_default_port.rb', line 27 def self.included(base) base.module_eval do # Default port to use property :default_port, Integer validates_present :default_port end end |
Instance Method Details
#initialize(attributes = {}, &block) ⇒ Object
Creates a new Model.
45 46 47 48 49 50 51 |
# File 'lib/ronin/model/has_default_port.rb', line 45 def initialize(attributes={},&block) if self.class.const_defined?('DEFAULT_PORT') attributes = {:default_port => self.class.const_get('DEFAULT_PORT')}.merge(attributes) end super(attributes,&block) end |