Class: Loghandler::Rules::OnRadioLogRule

Inherits:
AbstractRule show all
Defined in:
lib/loghandler/rules/on_radio_log_rule.rb

Instance Method Summary collapse

Methods inherited from AbstractRule

#loggable?

Constructor Details

#initialize(log_detail) ⇒ OnRadioLogRule

Returns a new instance of OnRadioLogRule.



5
6
7
# File 'lib/loghandler/rules/on_radio_log_rule.rb', line 5

def initialize(log_detail)
  @log_detail=log_detail
end

Instance Method Details

#apply!Object



13
14
15
# File 'lib/loghandler/rules/on_radio_log_rule.rb', line 13

def apply!
  @log_detail.merge!({converted:true})
end

#logObject



16
17
18
# File 'lib/loghandler/rules/on_radio_log_rule.rb', line 16

def log
  @log_detail.to_json
end

#match?Boolean

Returns:

  • (Boolean)


8
9
10
11
12
# File 'lib/loghandler/rules/on_radio_log_rule.rb', line 8

def match?
  # return true if (filename == "./log/access.log")
  return true if (@log_detail[:content].match(/Nouveau scan de page/))
  return false
end

#persist?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/loghandler/rules/on_radio_log_rule.rb', line 19

def persist?
  false
end

#showable?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/loghandler/rules/on_radio_log_rule.rb', line 22

def showable?
  true
end