Class: Mihari::Models::Rule
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Mihari::Models::Rule
- Includes:
- Concerns::Searchable, SearchCop
- Defined in:
- lib/mihari/models/rule.rb
Overview
Rule model
Instance Attribute Summary collapse
- #alerts ⇒ Array<Mihari::Models::Alert> readonly
- #created_at ⇒ DateTime
- #data ⇒ Hash
- #description ⇒ String
- #id ⇒ String
- #title ⇒ String
- #updated_at ⇒ DateTime
Instance Method Summary collapse
- #count_by_filter(filter) ⇒ Integer
- #search_by_filter(filter) ⇒ Array<Mihari::Models::Alert>
- #symbolized_data ⇒ Object
- #yaml ⇒ Object
Instance Attribute Details
#alerts ⇒ Array<Mihari::Models::Alert> (readonly)
30 |
# File 'lib/mihari/models/rule.rb', line 30 has_many :alerts, dependent: :destroy |
#created_at ⇒ DateTime
|
|
# File 'lib/mihari/models/rule.rb', line 21
|
#data ⇒ Hash
|
|
# File 'lib/mihari/models/rule.rb', line 18
|
#description ⇒ String
|
|
# File 'lib/mihari/models/rule.rb', line 15
|
#id ⇒ String
|
|
# File 'lib/mihari/models/rule.rb', line 9
|
#title ⇒ String
|
|
# File 'lib/mihari/models/rule.rb', line 12
|
#updated_at ⇒ DateTime
|
|
# File 'lib/mihari/models/rule.rb', line 24
|
Instance Method Details
#count_by_filter(filter) ⇒ Integer
|
|
# File 'lib/mihari/models/rule.rb', line 55
|
#search_by_filter(filter) ⇒ Array<Mihari::Models::Alert>
|
|
# File 'lib/mihari/models/rule.rb', line 51
|
#symbolized_data ⇒ Object
42 43 44 |
# File 'lib/mihari/models/rule.rb', line 42 def symbolized_data @symbolized_data ||= data.deep_symbolize_keys end |
#yaml ⇒ Object
46 47 48 |
# File 'lib/mihari/models/rule.rb', line 46 def yaml data.to_yaml end |