Module: Ronin::Model

Includes:
Types
Included in:
Address, Arch, Author, Campaign, Credential, EmailAddress, HostNameIPAddress, IPAddressMACAddress, License, OS, OSGuess, OpenPort, Organization, Password, Port, Repository, Script::Path, Service, Software, Target, URL, URLQueryParam, URLQueryParamName, URLScheme, UserName, Vendor
Defined in:
lib/ronin/model/model.rb,
lib/ronin/model/has_name.rb,
lib/ronin/model/has_title.rb,
lib/ronin/model/importable.rb,
lib/ronin/model/has_authors.rb,
lib/ronin/model/has_license.rb,
lib/ronin/model/has_version.rb,
lib/ronin/model/has_description.rb,
lib/ronin/model/has_unique_name.rb,
lib/ronin/model/types/description.rb

Overview

Modifies a class so that it can represent a DataMapper model in the Database.

Defined Under Namespace

Modules: ClassMethods, HasAuthors, HasDescription, HasLicense, HasName, HasTitle, HasUniqueName, HasVersion, Importable, InstanceMethods, Types

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Sets up a class as a DataMapper model that can be used with the Database. Also adds ClassMethods to the new model.

Parameters:

  • base (Class)

    The class that will be setup as a DataMapper model.



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/ronin/model/model.rb', line 45

def self.included(base)
  unless base < DataMapper::Resource
    base.send :include, DataMapper::Resource
  end

  base.send :include, DataMapper,
                      DataMapper::Migrations,
                      DataMapper::Serialize,
                      Model::Types,
                      InstanceMethods
  base.send :extend, ClassMethods
end