Class IRB::Notifier::AbstructNotifier
In: lib/irb/notifier.rb
Parent: Object

Methods

exec_if   new   notify?   pp   ppx   print   printf   printn   puts  

Attributes

prefix  [R] 

Public Class methods

[Source]

    # File lib/irb/notifier.rb, line 30
30:       def initialize(prefix, base_notifier)
31:         @prefix = prefix
32:         @base_notifier = base_notifier
33:       end

Public Instance methods

[Source]

    # File lib/irb/notifier.rb, line 71
71:       def exec_if
72:         yield(@base_notifier) if notify?
73:       end

[Source]

    # File lib/irb/notifier.rb, line 37
37:       def notify?
38:         true
39:       end

[Source]

    # File lib/irb/notifier.rb, line 59
59:       def pp(*objs)
60:         if notify?
61:           @base_notifier.ppx @prefix, *objs
62:         end
63:       end

[Source]

    # File lib/irb/notifier.rb, line 65
65:       def ppx(prefix, *objs)
66:         if notify?
67:           @base_notifier.ppx @prefix+prefix, *objs
68:         end
69:       end

[Source]

    # File lib/irb/notifier.rb, line 41
41:       def print(*opts)
42:         @base_notifier.print prefix, *opts if notify?
43:       end

[Source]

    # File lib/irb/notifier.rb, line 49
49:       def printf(format, *opts)
50:         @base_notifier.printf(prefix + format, *opts) if notify?
51:       end

[Source]

    # File lib/irb/notifier.rb, line 45
45:       def printn(*opts)
46:         @base_notifier.printn prefix, *opts if notify?
47:       end

[Source]

    # File lib/irb/notifier.rb, line 53
53:       def puts(*objs)
54:         if notify?
55:           @base_notifier.puts(*objs.collect{|obj| prefix + obj.to_s})
56:         end
57:       end

[Validate]