Class: IRB::Notifier::AbstractNotifier
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
| Subclasses: | |
| Inherits: | Object | 
| Defined in: | lib/irb/notifier.rb | 
Overview
An abstract class, or superclass, for CompositeNotifier and LeveledNotifier to inherit. It provides several wrapper methods for the ::IRB::OutputMethod object used by the ::IRB::Notifier.
Class Method Summary
- 
    
      .new(prefix, base_notifier)  ⇒ AbstractNotifier 
    
    constructor
    Creates a new ::IRB::Notifier object. 
Instance Attribute Summary
- 
    
      #notify?  ⇒ Boolean 
    
    readonly
    A wrapper method used to determine whether notifications are enabled. 
- 
    
      #prefix  
    
    readonly
    The prefixfor this ::IRB::Notifier, which is appended to all objects being inspected during output.
Instance Method Summary
- 
    
      #exec_if {|@base_notifier| ... } 
    
    Execute the given block if notifications are enabled. 
- #pp(*objs)
- #ppx(prefix, *objs)
- 
    
      #print(*opts)  
    
    See OutputMethod#print for more detail. 
- 
    
      #printf(format, *opts)  
    
    See OutputMethod#printf for more detail. 
- 
    
      #printn(*opts)  
    
    See OutputMethod#printn for more detail. 
- 
    
      #puts(*objs)  
    
    See OutputMethod#puts for more detail. 
Constructor Details
    .new(prefix, base_notifier)  ⇒ AbstractNotifier 
  
Creates a new ::IRB::Notifier object
Instance Attribute Details
    #notify?  ⇒ Boolean  (readonly)
  
A wrapper method used to determine whether notifications are enabled.
Defaults to true.
# File 'lib/irb/notifier.rb', line 54
def notify? true end
#prefix (readonly)
The prefix for this ::IRB::Notifier, which is appended to all objects being inspected during output.
# File 'lib/irb/notifier.rb', line 49
attr_reader :prefix
Instance Method Details
#exec_if {|@base_notifier| ... }
Execute the given block if notifications are enabled.
# File 'lib/irb/notifier.rb', line 100
def exec_if yield(@base_notifier) if notify? end
#pp(*objs)
Same as #ppx, except it uses the #prefix given during object initialization. See OutputMethod#ppx for more detail.
#ppx(prefix, *objs)
Same as #pp, except it concatenates the given #prefix with the #prefix given during object initialization.
See OutputMethod#ppx for more detail.
#print(*opts)
See OutputMethod#print for more detail.
#printf(format, *opts)
See OutputMethod#printf for more detail.
#printn(*opts)
See OutputMethod#printn for more detail.
#puts(*objs)
See OutputMethod#puts for more detail.