Class: IRB::Notifier::LeveledNotifier
- Inherits:
-
AbstractNotifier
- Object
- AbstractNotifier
- IRB::Notifier::LeveledNotifier
- Includes:
- Comparable
- Defined in:
- lib/irb/notifier.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#level ⇒ Object
readonly
Returns the value of attribute level.
Attributes inherited from AbstractNotifier
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(base, level, prefix) ⇒ LeveledNotifier
constructor
A new instance of LeveledNotifier.
- #notify? ⇒ Boolean
Methods inherited from AbstractNotifier
#exec_if, #pp, #ppx, #print, #printf, #printn, #puts
Constructor Details
#initialize(base, level, prefix) ⇒ LeveledNotifier
Returns a new instance of LeveledNotifier.
113 114 115 116 117 |
# File 'lib/irb/notifier.rb', line 113 def initialize(base, level, prefix) super(prefix, base) @level = level end |
Instance Attribute Details
#level ⇒ Object (readonly)
Returns the value of attribute level
119 120 121 |
# File 'lib/irb/notifier.rb', line 119 def level @level end |
Instance Method Details
#<=>(other) ⇒ Object
121 122 123 |
# File 'lib/irb/notifier.rb', line 121 def <=>(other) @level <=> other.level end |
#notify? ⇒ Boolean
125 126 127 |
# File 'lib/irb/notifier.rb', line 125 def notify? @base_notifier.level >= self end |