Class: Irc::Channel::ModeHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/rbot/irc.rb

Overview

Hash of modes. Subclass of Hash that defines any? and all? to check if boolean modes (Type D) are set

Instance Method Summary collapse

Instance Method Details

#all?(*ar) ⇒ Boolean

Returns:

  • (Boolean)


1143
1144
1145
# File 'lib/rbot/irc.rb', line 1143

def all?(*ar)
  !ar.find { |m| s = m.to_sym ; !(self[s] && self[s].set?) }
end

#any?(*ar) ⇒ Boolean

Returns:

  • (Boolean)


1140
1141
1142
# File 'lib/rbot/irc.rb', line 1140

def any?(*ar)
  !!ar.find { |m| s = m.to_sym ; self[s] && self[s].set? }
end