Class: IRB::Notifier::LeveledNotifier
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
AbstractNotifier
|
|
Instance Chain:
self,
Comparable,
AbstractNotifier
|
|
Inherits: |
IRB::Notifier::AbstractNotifier
|
Defined in: | lib/irb/notifier.rb |
Overview
A leveled notifier is comparable to the composite group from CompositeNotifier#notifiers.
Class Method Summary
-
.new(base, level, prefix) ⇒ LeveledNotifier
constructor
Create a new leveled notifier with the given
base
, andprefix
to send to AbstractNotifier.new
AbstractNotifier
- Inherited
.new | Creates a new |
Instance Attribute Summary
-
#level
readonly
The current level of this notifier object.
-
#notify? ⇒ Boolean
readonly
Whether to output messages to the output method, depending on the level of this notifier object.
AbstractNotifier
- Inherited
#notify? | A wrapper method used to determine whether notifications are enabled. |
#prefix | The |
Instance Method Summary
-
#<=>(other)
Compares the level of this notifier object with the given
other
notifier.
AbstractNotifier
- Inherited
#exec_if | Execute the given block if notifications are enabled. |
#pp | Same as |
#ppx | Same as |
See OutputMethod#print for more detail. |
|
#printf | See OutputMethod#printf for more detail. |
#printn | See OutputMethod#printn for more detail. |
#puts | See OutputMethod#puts for more detail. |
Constructor Details
.new(base, level, prefix) ⇒ LeveledNotifier
Create a new leveled notifier with the given base
, and prefix
to send to AbstractNotifier.new
The given #level is used to compare other leveled notifiers in the CompositeNotifier
group to determine whether or not to output notifications.
Instance Attribute Details
#level (readonly)
The current level of this notifier object
# File 'lib/irb/notifier.rb', line 197
attr_reader :level
#notify? ⇒ Boolean
(readonly)
Whether to output messages to the output method, depending on the level of this notifier object.
# File 'lib/irb/notifier.rb', line 209
def notify? @base_notifier.level >= self end
Instance Method Details
#<=>(other)
Compares the level of this notifier object with the given other
notifier.
See the Comparable module for more information.
# File 'lib/irb/notifier.rb', line 203
def <=>(other) @level <=> other.level end