Class: IRB::Notifier::LeveledNotifier
- Inherits:
-
AbstructNotifier
- Object
- AbstructNotifier
- 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 AbstructNotifier
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(base, level, prefix) ⇒ LeveledNotifier
constructor
A new instance of LeveledNotifier.
- #notify? ⇒ Boolean
Methods inherited from AbstructNotifier
#exec_if, #pp, #ppx, #print, #printf, #printn, #puts
Constructor Details
#initialize(base, level, prefix) ⇒ LeveledNotifier
Returns a new instance of LeveledNotifier.
114 115 116 117 118 |
# File 'lib/irb/notifier.rb', line 114 def initialize(base, level, prefix) super(prefix, base) @level = level end |
Instance Attribute Details
#level ⇒ Object (readonly)
Returns the value of attribute level
120 121 122 |
# File 'lib/irb/notifier.rb', line 120 def level @level end |
Instance Method Details
#<=>(other) ⇒ Object
122 123 124 |
# File 'lib/irb/notifier.rb', line 122 def <=>(other) @level <=> other.level end |
#notify? ⇒ Boolean
126 127 128 |
# File 'lib/irb/notifier.rb', line 126 def notify? @base_notifier.level >= self end |