Class: IRB::Notifier::LeveledNotifier

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

Direct Known Subclasses

NoMsgNotifier

Instance Attribute Summary collapse

Attributes inherited from AbstructNotifier

#prefix

Instance Method Summary collapse

Methods inherited from AbstructNotifier

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

Constructor Details

#initialize(base, level, prefix) ⇒ LeveledNotifier

Returns a new instance of LeveledNotifier.



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

def initialize(base, level, prefix)
	super(prefix, base)
	
	@level = level
end

Instance Attribute Details

#levelObject (readonly)

Returns the value of attribute level



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

def level
  @level
end

Instance Method Details

#<=>(other) ⇒ Object



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

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

#notify?Boolean

Returns:

  • (Boolean)


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

def notify?
	@base_notifier.level >= self
end