Module: IIRC::ISupport::Inquiry
- Defined in:
- lib/iirc/modules/isupport.rb
Overview
Methods for inquiry into a Hash of raw ISUPPORT key=>value pairs. These are mixed in to the Hash returned by #isupport.
The key=>value format returned by #isupport won't change. Rather, methods which process the values can be added here.
Instance Method Summary collapse
-
#bot_mode ⇒ String?
User mode which can be used to mark clients as bots.
-
#bot_mode? ⇒ Boolean
Whether or not the server supports a user mode which lets clients mark themselves as bots.
-
#case_mapping ⇒ String
A string indicating the case mapping used by the server to determine case-insensitive equality of channel names and nick names.
-
#channel_prefixes ⇒ Array
Characters used as channel prefixes by this server.
-
#prefix_modes ⇒ Hash<String,String>
Modes which grant privileges to a user in a channel and their respective prefix characters seen in NAMES, WHO and WHOIS replies.
Instance Method Details
#bot_mode ⇒ String?
User mode which can be used to mark clients as bots.
55 56 57 |
# File 'lib/iirc/modules/isupport.rb', line 55 def bot_mode self['BOT'] end |
#bot_mode? ⇒ Boolean
Whether or not the server supports a user mode which lets clients mark themselves as bots.
48 49 50 |
# File 'lib/iirc/modules/isupport.rb', line 48 def bot_mode? !!bot_mode end |
#case_mapping ⇒ String
IIRC does not currently perform case-insensitive comparisons. This may change in future.
A string indicating the case mapping used by the server to determine case-insensitive equality of channel names and nick names.
64 65 66 |
# File 'lib/iirc/modules/isupport.rb', line 64 def case_mapping self['CASEMAPPING'] end |
#channel_prefixes ⇒ Array
Characters used as channel prefixes by this server.
71 72 73 |
# File 'lib/iirc/modules/isupport.rb', line 71 def channel_prefixes (@channel_prefixes ||= self['CHANTYPES']&.chars.freeze) || ['#'].freeze end |
#prefix_modes ⇒ Hash<String,String>
Modes which grant privileges to a user in a channel and their respective prefix characters seen in NAMES, WHO and WHOIS replies.
81 82 83 84 85 86 87 88 |
# File 'lib/iirc/modules/isupport.rb', line 81 def prefix_modes if self['PREFIX'].is_a? String modes, symbols = self['PREFIX'][1..].split(')').map!(&:chars) Hash[modes.zip(symbols)].freeze else {}.freeze end end |