Class: Ronin::DB::Software
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Ronin::DB::Software
- Includes:
- Model, Model::HasName
- Defined in:
- lib/ronin/db/software.rb
Overview
Represents a Software product.
Instance Attribute Summary collapse
-
#id ⇒ Integer
The primary key of the software.
-
#name ⇒ String
The software's name.
-
#open_ports ⇒ Array<OpenPort>
The open ports running the software.
-
#vendor ⇒ SoftwareVendor?
The vendor of the software.
-
#version ⇒ String
The software's Version.
Class Method Summary collapse
-
.with_vendor_name(name) ⇒ Array<Software>
Queries all software with the matching vendor name.
-
.with_version(version) ⇒ Array<Software>
Queries all software with the matching version.
Instance Method Summary collapse
-
#to_s ⇒ String
Converts the software to a String.
Methods included from Model::HasName
Methods included from Model
Instance Attribute Details
#id ⇒ Integer
The primary key of the software.
40 |
# File 'lib/ronin/db/software.rb', line 40 attribute :id, :integer |
#name ⇒ String
The software's name.
46 |
# File 'lib/ronin/db/software.rb', line 46 attribute :name, :string |
#open_ports ⇒ Array<OpenPort>
The open ports running the software
68 |
# File 'lib/ronin/db/software.rb', line 68 has_many :open_ports |
#vendor ⇒ SoftwareVendor?
The vendor of the software
61 62 |
# File 'lib/ronin/db/software.rb', line 61 belongs_to :vendor, optional: true, class_name: 'SoftwareVendor' |
#version ⇒ String
The software's Version.
53 |
# File 'lib/ronin/db/software.rb', line 53 attribute :version, :string |
Class Method Details
.with_vendor_name(name) ⇒ Array<Software>
Queries all software with the matching vendor name.
100 101 102 |
# File 'lib/ronin/db/software.rb', line 100 def self.with_vendor_name(name) joins(:vendor).where(vendor: {name: name}) end |
.with_version(version) ⇒ Array<Software>
Queries all software with the matching version.
83 84 85 |
# File 'lib/ronin/db/software.rb', line 83 def self.with_version(version) where(version: version) end |
Instance Method Details
#to_s ⇒ String
Converts the software to a String.
112 113 114 |
# File 'lib/ronin/db/software.rb', line 112 def to_s [self.vendor, self.name, self.version].compact.join(' ') end |