class Cinch::Network
This class allows querying the IRC
network for its name and used server software as well as certain non-standard behaviour.
@since 2.0.0
Attributes
@return [Array<Symbol>] All client capabilities supported by the network.
@return [Symbol] The server software used by the network.
`:unknown` if the software couldn't be detected.
@return [Symbol] The name of the network. `:unknown` if the
network couldn't be detected.
Public Class Methods
@param [Symbol] name @param [Symbol] ircd @api private @note The user should not create instances of this class but use
{IRC#network} instead.
# File lib/cinch/network.rb, line 33 def initialize(name, ircd) @name = name @ircd = ircd @capabilities = [] end
Public Instance Methods
@return [Numeric] The `messages per second` value that best suits
the current network
# File lib/cinch/network.rb, line 84 def default_messages_per_second case @name when :freenode 0.7 else 0.5 end end
@return [Integer] The `server queue size` value that best suits
the current network
# File lib/cinch/network.rb, line 95 def default_server_queue_size case @name when :quakenet 40 else 10 end end
@return [Boolean] True if connected to JTV
# File lib/cinch/network.rb, line 62 def jtv? @name == :jtv end
@return [Boolean] True if connected to NgameTV
# File lib/cinch/network.rb, line 57 def ngametv? @name == :ngametv end
@return [String, nil] The mode used for getting the list of
channel owners, if any
# File lib/cinch/network.rb, line 41 def owner_list_mode return "q" if @ircd == :unreal end
@return [String, nil] The mode used for getting the list of
channel quiets, if any
# File lib/cinch/network.rb, line 47 def quiet_list_mode return "q" if @ircd == :"ircd-seven" end
@return [Boolean] True if we do not know which software the
server is running
# File lib/cinch/network.rb, line 74 def unknown_ircd? @ircd == :unknown end
@return [Boolean] True if we do not know which network we are
connected to
# File lib/cinch/network.rb, line 68 def unknown_network? @name == :unknown end
@return [Boolean] Does WHOIS only support one argument?
# File lib/cinch/network.rb, line 52 def whois_only_one_argument? @name == :jtv end