Class: Loghandler::Rules::AbstractRule

Inherits:
Object
  • Object
show all
Defined in:
lib/loghandler/rules/abstract_rule.rb

Instance Method Summary collapse

Constructor Details

#initialize(log_detail) ⇒ AbstractRule

Returns a new instance of AbstractRule.



4
5
6
# File 'lib/loghandler/rules/abstract_rule.rb', line 4

def initialize(log_detail)
  raise "initialize is abstract. Provide an implementation"
end

Instance Method Details

#apply!Object



11
12
13
# File 'lib/loghandler/rules/abstract_rule.rb', line 11

def apply!
  raise "convert is abstract. Provide an implementation"
end

#loggable?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/loghandler/rules/abstract_rule.rb', line 14

def loggable?
  true
end

#match?Boolean

Returns:

  • (Boolean)


7
8
9
10
# File 'lib/loghandler/rules/abstract_rule.rb', line 7

def match?
  return true if self.class.name.underscore == ["loghandler/rules/",@log_detail[:log_type], "_rule"].join
  return false
end

#persist?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/loghandler/rules/abstract_rule.rb', line 17

def persist?
  raise "persist is abstract. Provide an implementation"
end