Module: Ronin::Model::TargetsSoftware

Included in:
Exploits::Target
Defined in:
lib/ronin/model/targets_software.rb

Overview

Adds a software relation between the model and the Ronin::Software model.

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object


33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/ronin/model/targets_software.rb', line 33

def self.included(base)
  base.send :include, InstanceMethods
  base.send :extend, ClassMethods

  base.module_eval do
    # The targeted software
    belongs_to :software,
               model: 'Ronin::Software',
               required: false
  end

  Software.has Software.n, base.relationship_name, model: base.name
end