Class: IRB::Notifier::LeveledNotifier

Inherits:
AbstractNotifier show all
Includes:
Comparable
Defined in:
lib/irb/notifier.rb

Direct Known Subclasses

NoMsgNotifier

Instance Attribute Summary collapse

Attributes inherited from AbstractNotifier

#prefix

Instance Method Summary collapse

Methods inherited from AbstractNotifier

#exec_if, #pp, #ppx, #print, #printf, #printn, #puts

Constructor Details

#initialize(base, level, prefix) ⇒ LeveledNotifier

Returns a new instance of LeveledNotifier.



113
114
115
116
117
# File 'lib/irb/notifier.rb', line 113

def initialize(base, level, prefix)
	super(prefix, base)

	@level = level
end

Instance Attribute Details

#levelObject (readonly)

Returns the value of attribute level



119
120
121
# File 'lib/irb/notifier.rb', line 119

def level
  @level
end

Instance Method Details

#<=>(other) ⇒ Object



121
122
123
# File 'lib/irb/notifier.rb', line 121

def <=>(other)
	@level <=> other.level
end

#notify?Boolean

Returns:

  • (Boolean)


125
126
127
# File 'lib/irb/notifier.rb', line 125

def notify?
	@base_notifier.level >= self
end