In Files

  • irb/notifier.rb

IRB::Notifier::AbstructNotifier

Attributes

prefix[R]

Public Class Methods

new(prefix, base_notifier) click to toggle source
 
               # File irb/notifier.rb, line 30
def initialize(prefix, base_notifier)
  @prefix = prefix
  @base_notifier = base_notifier
end
            

Public Instance Methods

exec_if() click to toggle source
 
               # File irb/notifier.rb, line 71
def exec_if
  yield(@base_notifier) if notify?
end
            
notify?() click to toggle source
 
               # File irb/notifier.rb, line 37
def notify?
  true
end
            
pp(*objs) click to toggle source
 
               # File irb/notifier.rb, line 59
def pp(*objs)
  if notify?
    @base_notifier.ppx @prefix, *objs
  end
end
            
ppx(prefix, *objs) click to toggle source
 
               # File irb/notifier.rb, line 65
def ppx(prefix, *objs)
  if notify?
    @base_notifier.ppx @prefix+prefix, *objs
  end
end
            
printf(format, *opts) click to toggle source
 
               # File irb/notifier.rb, line 49
def printf(format, *opts)
  @base_notifier.printf(prefix + format, *opts) if notify?
end
            
printn(*opts) click to toggle source
 
               # File irb/notifier.rb, line 45
def printn(*opts)
  @base_notifier.printn prefix, *opts if notify?
end
            
puts(*objs) click to toggle source
 
               # File irb/notifier.rb, line 53
def puts(*objs)
  if notify?
    @base_notifier.puts(*objs.collect{|obj| prefix + obj.to_s})
  end
end