Class: Cinch::Network
- Inherits:
-
Object
- Object
- Cinch::Network
- Defined in:
- lib/cinch/network.rb
Overview
This class allows querying the IRC network for its name and used server software as well as certain non-standard behaviour.
Instance Attribute Summary (collapse)
-
- (Array<Symbol>) capabilities
network.
-
- (Symbol) ircd
The server software used by the network.
-
- (Symbol) name
The name of the network.
Instance Method Summary (collapse)
-
- (Numeric) default_messages_per_second
The
messages per secondvalue that best suits the current network. -
- (Integer) default_server_queue_size
The
server queue sizevalue that best suits the current network. -
- (Network) initialize(name, ircd)
constructor
private
A new instance of Network.
-
- (Boolean) jtv?
True if connected to JTV.
-
- (Boolean) ngametv?
True if connected to NgameTV.
-
- (String?) owner_list_mode
The mode used for getting the list of channel owners, if any.
-
- (String?) quiet_list_mode
The mode used for getting the list of channel quiets, if any.
-
- (Boolean) unknown_ircd?
True if we do not know which software the server is running.
-
- (Boolean) unknown_network?
True if we do not know which network we are connected to.
-
- (Boolean) whois_only_one_argument?
Does WHOIS only support one argument?.
Constructor Details
- (Network) initialize(name, ircd)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The user should not create instances of this class but use IRC#network instead.
A new instance of Network
33 34 35 36 37 |
# File 'lib/cinch/network.rb', line 33 def initialize(name, ircd) @name = name @ircd = ircd @capabilities = [] end |
Instance Attribute Details
- (Array<Symbol>) capabilities
network.
23 24 25 |
# File 'lib/cinch/network.rb', line 23 def capabilities @capabilities end |
- (Symbol) ircd
The server software used by the network.
:unknown if the software couldn’t be detected.
16 17 18 |
# File 'lib/cinch/network.rb', line 16 def ircd @ircd end |
- (Symbol) name
The name of the network. :unknown if the
network couldn’t be detected.
9 10 11 |
# File 'lib/cinch/network.rb', line 9 def name @name end |
Instance Method Details
- (Numeric) default_messages_per_second
The messages per second value that best suits
the current network
84 85 86 87 88 89 90 91 |
# File 'lib/cinch/network.rb', line 84 def case @name when :freenode 0.7 else 0.5 end end |
- (Integer) default_server_queue_size
The server queue size value that best suits
the current network
95 96 97 98 99 100 101 102 |
# File 'lib/cinch/network.rb', line 95 def default_server_queue_size case @name when :quakenet 40 else 10 end end |
- (Boolean) jtv?
True if connected to JTV
62 63 64 |
# File 'lib/cinch/network.rb', line 62 def jtv? @name == :jtv end |
- (Boolean) ngametv?
True if connected to NgameTV
57 58 59 |
# File 'lib/cinch/network.rb', line 57 def ngametv? @name == :ngametv end |
- (String?) owner_list_mode
The mode used for getting the list of channel owners, if any
41 42 43 |
# File 'lib/cinch/network.rb', line 41 def owner_list_mode return "q" if @ircd == :unreal end |
- (String?) quiet_list_mode
The mode used for getting the list of channel quiets, if any
47 48 49 |
# File 'lib/cinch/network.rb', line 47 def quiet_list_mode return "q" if @ircd == :ircd-seven" end |
- (Boolean) unknown_ircd?
True if we do not know which software the server is running
74 75 76 |
# File 'lib/cinch/network.rb', line 74 def unknown_ircd? @ircd == :unknown end |
- (Boolean) unknown_network?
True if we do not know which network we are connected to
68 69 70 |
# File 'lib/cinch/network.rb', line 68 def unknown_network? @name == :unknown end |
- (Boolean) whois_only_one_argument?
Does WHOIS only support one argument?
52 53 54 |
# File 'lib/cinch/network.rb', line 52 def whois_only_one_argument? @name == :jtv end |