Module: Ronin::Model::TargetsArch

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

Overview

Adds a arch relation between a model and the Ronin::Arch model.

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object


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

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

  base.module_eval do
    # The targeted architecture
    belongs_to :arch,
               model: 'Ronin::Arch',
               required: false
  end

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