Class: Mihari::Models::Rule

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Concerns::Searchable, SearchCop
Defined in:
lib/mihari/models/rule.rb

Overview

Rule model

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#alertsArray<Mihari::Models::Alert> (readonly)

Returns:



30
# File 'lib/mihari/models/rule.rb', line 30

has_many :alerts, dependent: :destroy

#created_atDateTime

Returns:

  • (DateTime)


# File 'lib/mihari/models/rule.rb', line 21


#dataHash

Returns:

  • (Hash)


# File 'lib/mihari/models/rule.rb', line 18


#descriptionString

Returns:

  • (String)


# File 'lib/mihari/models/rule.rb', line 15


#idString

Returns:

  • (String)


# File 'lib/mihari/models/rule.rb', line 9


#titleString

Returns:

  • (String)


# File 'lib/mihari/models/rule.rb', line 12


#updated_atDateTime

Returns:

  • (DateTime)


# File 'lib/mihari/models/rule.rb', line 24


Instance Method Details

#count_by_filter(filter) ⇒ Integer

Parameters:

Returns:

  • (Integer)


# File 'lib/mihari/models/rule.rb', line 55


#search_by_filter(filter) ⇒ Array<Mihari::Models::Alert>

Parameters:

Returns:



# File 'lib/mihari/models/rule.rb', line 51


#symbolized_dataObject



42
43
44
# File 'lib/mihari/models/rule.rb', line 42

def symbolized_data
  @symbolized_data ||= data.deep_symbolize_keys
end

#yamlObject



46
47
48
# File 'lib/mihari/models/rule.rb', line 46

def yaml
  data.to_yaml
end