Extended maintenance of Ruby versions 1.8.7 and 1.9.2 will end on July 31, 2014. Read more

In Files

  • irb/notifier.rb

IRB::Notifier::AbstractNotifier

Attributes

prefix[R]

Public Class Methods

new(prefix, base_notifier) click to toggle source
 
               # File irb/notifier.rb, line 29
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 70
def exec_if
  yield(@base_notifier) if notify?
end
            
notify?() click to toggle source
 
               # File irb/notifier.rb, line 36
def notify?
  true
end
            
pp(*objs) click to toggle source
 
               # File irb/notifier.rb, line 58
def pp(*objs)
  if notify?
    @base_notifier.ppx @prefix, *objs
  end
end
            
ppx(prefix, *objs) click to toggle source
 
               # File irb/notifier.rb, line 64
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 48
def printf(format, *opts)
  @base_notifier.printf(prefix + format, *opts) if notify?
end
            
printn(*opts) click to toggle source
 
               # File irb/notifier.rb, line 44
def printn(*opts)
  @base_notifier.printn prefix, *opts if notify?
end
            
puts(*objs) click to toggle source
 
               # File irb/notifier.rb, line 52
def puts(*objs)
  if notify?
    @base_notifier.puts(*objs.collect{|obj| prefix + obj.to_s})
  end
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus