Class: Ronin::DB::Address
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Ronin::DB::Address
- Includes:
- Model, Model::Importable, Model::LastScannedAt
- Defined in:
- lib/ronin/db/address.rb
Overview
A base model which represents an Internet Address, such as:
Direct Known Subclasses
Instance Attribute Summary collapse
-
#address ⇒ String
The Address.
-
#created_at ⇒ Time
Tracks when the IP Address was first created.
-
#id ⇒ Integer
The primary key of the Address.
Attributes included from Model::LastScannedAt
Class Method Summary collapse
-
.import(address) ⇒ Address
Imports an address.
-
.lookup(address) ⇒ Address?
Looks up the address.
Instance Method Summary collapse
-
#to_s ⇒ String
Converts the address into a string.
Methods included from Model::LastScannedAt
Methods included from Model::Importable
Methods included from Model
Instance Attribute Details
#address ⇒ String
The Address
54 |
# File 'lib/ronin/db/address.rb', line 54 attribute :address, :string |
#created_at ⇒ Time
Tracks when the IP Address was first created
61 |
# File 'lib/ronin/db/address.rb', line 61 attribute :created_at, :datetime |
#id ⇒ Integer
The primary key of the Address
48 |
# File 'lib/ronin/db/address.rb', line 48 attribute :id, :integer |
Class Method Details
.import(address) ⇒ Address
Imports an address.
89 90 91 |
# File 'lib/ronin/db/address.rb', line 89 def self.import(address) create(address: address) end |
.lookup(address) ⇒ Address?
Looks up the address.
74 75 76 |
# File 'lib/ronin/db/address.rb', line 74 def self.lookup(address) find_by(address: address) end |
Instance Method Details
#to_s ⇒ String
Converts the address into a string.
101 102 103 |
# File 'lib/ronin/db/address.rb', line 101 def to_s self.address.to_s end |