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
  @levels = {}
  @categories = {}
  @origins = {}
  @exceptions = {}
end

Instance Attribute Details

#categoriesObject (readonly)

Returns the value of attribute categories.



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

def categories
  @categories
end

#exceptionsObject (readonly)

Returns the value of attribute exceptions.



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

def exceptions
  @exceptions
end

#levelsObject (readonly)

Returns the value of attribute levels.



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

def levels
  @levels
end

#originsObject (readonly)

Returns the value of attribute origins.



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

def origins
  @origins
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