Class: ExtendedLogger::Level
- Inherits:
-
Struct
- Object
- Struct
- ExtendedLogger::Level
- Includes:
- Comparable
- Defined in:
- lib/extended_logger/level.rb,
lib/extended_logger/level/set.rb
Defined Under Namespace
Classes: Set
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#next ⇒ Object
Returns the value of attribute next.
-
#prev ⇒ Object
Returns the value of attribute prev.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
2 3 4 |
# File 'lib/extended_logger/level.rb', line 2 def name @name end |
#next ⇒ Object
Returns the value of attribute next
2 3 4 |
# File 'lib/extended_logger/level.rb', line 2 def next @next end |
#prev ⇒ Object
Returns the value of attribute prev
2 3 4 |
# File 'lib/extended_logger/level.rb', line 2 def prev @prev end |
Instance Method Details
#<=>(other) ⇒ Object
5 6 7 |
# File 'lib/extended_logger/level.rb', line 5 def <=> other self.ordinal <=> other.ordinal end |
#abbreviation ⇒ Object
9 10 11 |
# File 'lib/extended_logger/level.rb', line 9 def abbreviation label[0] end |
#label ⇒ Object
17 18 19 |
# File 'lib/extended_logger/level.rb', line 17 def label @label ||= name.to_s.upcase end |
#ordinal ⇒ Object
13 14 15 |
# File 'lib/extended_logger/level.rb', line 13 def ordinal @ordinal ||= if prev then prev.ordinal + 1 else 0 end end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/extended_logger/level.rb', line 21 def to_s label end |