Class: Steno::LogLevel

Inherits:
Object show all
Includes:
Comparable
Defined in:
lib/steno/log_level.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, priority) ⇒ LogLevel

Returns a new instance of LogLevel.

Parameters:

  • name (String)

    “info”, “debug”, etc.

  • priority (Integer)

    “info” > “debug”, etc.



11
12
13
14
# File 'lib/steno/log_level.rb', line 11

def initialize(name, priority)
  @name = name
  @priority = priority
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/steno/log_level.rb', line 7

def name
  @name
end

#priorityObject (readonly)

Returns the value of attribute priority.



7
8
9
# File 'lib/steno/log_level.rb', line 7

def priority
  @priority
end

Instance Method Details

#<=>(other) ⇒ Object



20
21
22
# File 'lib/steno/log_level.rb', line 20

def <=>(other)
  @priority <=> other.priority
end

#to_sObject



16
17
18
# File 'lib/steno/log_level.rb', line 16

def to_s
  @name.to_s
end