Module: Log::Levels

Included in:
Log
Defined in:
lib/log/levels.rb

Defined Under Namespace

Modules: AddLevels

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(cls) ⇒ Object



3
4
5
# File 'lib/log/levels.rb', line 3

def self.included(cls)
  cls.extend AddLevels
end

Instance Method Details

#level_namesObject



17
18
19
# File 'lib/log/levels.rb', line 17

def level_names
  levels.keys.dup
end

#levelsObject Also known as: logger_levels



7
8
9
# File 'lib/log/levels.rb', line 7

def levels
  @levels ||= {}
end

#levels?Boolean Also known as: logger_levels?

Returns:

  • (Boolean)


12
13
14
# File 'lib/log/levels.rb', line 12

def levels?
  !levels.empty?
end