Module: Ronin::Model::TargetsOS

Included in:
Encoders::Encoder, Exploits::Target, Payloads::Payload
Defined in:
lib/ronin/model/targets_os.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Adds an os relation between a model and the Ronin::OS model.


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

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

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

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