Class: Mdm::Tag
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- Mdm::Tag
- Includes:
- Metasploit::Model::Search
- Defined in:
- app/models/mdm/tag.rb
Overview
Tag assigned to #hosts. Tags can be used to group together hosts for targeting and reporting.
Instance Attribute Summary collapse
-
#created_at ⇒ DateTime
When this tag was created by #user.
-
#critical ⇒ true, false
Whether this tag represents a critical finding about the #hosts.
-
#desc ⇒ String
Longer description of what this tag should be used for or means when applied to a host.
-
#name ⇒ String
The name of the tag.
-
#report_detail ⇒ true, false
Whether to include this tag in a report details section.
-
#report_summary ⇒ true, false
Whether to include this tag in a report summary section.
-
#updated_at ⇒ DateTime
The last time this tag was updated.
Instance Method Summary collapse
-
#destroy_if_orphaned ⇒ void
Destroy this tag if it has no #hosts_tags.
-
#to_s ⇒ String
The name of the tag.
Instance Attribute Details
#created_at ⇒ DateTime
When this tag was created by #user.
|
# File 'app/models/mdm/tag.rb', line 31
|
#critical ⇒ true, false
Whether this tag represents a critical finding about the #hosts.
|
# File 'app/models/mdm/tag.rb', line 36
|
#desc ⇒ String
Longer description of what this tag should be used for or means when applied to a host.
|
# File 'app/models/mdm/tag.rb', line 42
|
#name ⇒ String
The name of the tag. The name is what a user actually enters to tag a host.
|
# File 'app/models/mdm/tag.rb', line 47
|
#report_detail ⇒ true, false
Whether to include this tag in a report details section.
|
# File 'app/models/mdm/tag.rb', line 52
|
#report_summary ⇒ true, false
Whether to include this tag in a report summary section.
|
# File 'app/models/mdm/tag.rb', line 58
|
#updated_at ⇒ DateTime
The last time this tag was updated.
|
# File 'app/models/mdm/tag.rb', line 64
|
Instance Method Details
#destroy_if_orphaned ⇒ void
This method returns an undefined value.
Destroy this tag if it has no #hosts_tags
100 101 102 103 104 105 106 |
# File 'app/models/mdm/tag.rb', line 100 def destroy_if_orphaned self.class.transaction do if .empty? destroy end end end |
#to_s ⇒ String
The name of the tag. The name is what a user actually enters to tag a host.
109 110 111 |
# File 'app/models/mdm/tag.rb', line 109 def to_s name end |