Class: IRB::Notifier::AbstructNotifier
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(prefix, base_notifier) ⇒ AbstructNotifier
Returns a new instance of AbstructNotifier.
30
31
32
33
|
# File 'lib/irb/notifier.rb', line 30
def initialize(prefix, base_notifier)
@prefix = prefix
@base_notifier = base_notifier
end
|
Instance Attribute Details
Returns the value of attribute prefix
35
36
37
|
# File 'lib/irb/notifier.rb', line 35
def prefix
@prefix
end
|
Instance Method Details
#exec_if {|@base_notifier| ... } ⇒ Object
71
72
73
|
# File 'lib/irb/notifier.rb', line 71
def exec_if
yield(@base_notifier) if notify?
end
|
#notify? ⇒ Boolean
37
38
39
|
# File 'lib/irb/notifier.rb', line 37
def notify?
true
end
|
#pp(*objs) ⇒ Object
59
60
61
62
63
|
# File 'lib/irb/notifier.rb', line 59
def pp(*objs)
if notify?
@base_notifier.ppx @prefix, *objs
end
end
|
#ppx(prefix, *objs) ⇒ Object
65
66
67
68
69
|
# File 'lib/irb/notifier.rb', line 65
def ppx(prefix, *objs)
if notify?
@base_notifier.ppx @prefix+prefix, *objs
end
end
|
#print(*opts) ⇒ Object
41
42
43
|
# File 'lib/irb/notifier.rb', line 41
def print(*opts)
@base_notifier.print prefix, *opts if notify?
end
|
#printf(format, *opts) ⇒ Object
49
50
51
|
# File 'lib/irb/notifier.rb', line 49
def printf(format, *opts)
@base_notifier.printf(prefix + format, *opts) if notify?
end
|
#printn(*opts) ⇒ Object
45
46
47
|
# File 'lib/irb/notifier.rb', line 45
def printn(*opts)
@base_notifier.printn prefix, *opts if notify?
end
|
#puts(*objs) ⇒ Object
53
54
55
56
57
|
# File 'lib/irb/notifier.rb', line 53
def puts(*objs)
if notify?
@base_notifier.puts(*objs.collect{|obj| prefix + obj.to_s})
end
end
|