Class: Sherlog::CountListener

Inherits:
Object
  • Object
show all
Defined in:
lib/sherlog_holmes/listeners/count_listener.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCountListener

Returns a new instance of CountListener.



28
29
30
31
32
33
# File 'lib/sherlog_holmes/listeners/count_listener.rb', line 28

def initialize
  @level = {}
  @category = {}
  @origin = {}
  @exception = {}
end

Instance Attribute Details

#categoryObject (readonly)

Returns the value of attribute category.



26
27
28
# File 'lib/sherlog_holmes/listeners/count_listener.rb', line 26

def category
  @category
end

#exceptionObject (readonly)

Returns the value of attribute exception.



26
27
28
# File 'lib/sherlog_holmes/listeners/count_listener.rb', line 26

def exception
  @exception
end

#levelObject (readonly)

Returns the value of attribute level.



26
27
28
# File 'lib/sherlog_holmes/listeners/count_listener.rb', line 26

def level
  @level
end

#originObject (readonly)

Returns the value of attribute origin.



26
27
28
# File 'lib/sherlog_holmes/listeners/count_listener.rb', line 26

def origin
  @origin
end

Instance Method Details

#call(entry) ⇒ Object



35
36
37
38
# File 'lib/sherlog_holmes/listeners/count_listener.rb', line 35

def call(entry)
  initialize_counters entry
  count entry
end