Parent

Class/Module Index [+]

Quicksearch

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

capabilities[RW]

@return [Array<Symbol>] All client capabilities supported by the network.

ircd[RW]

@return [Symbol] The server software used by the network.

`:unknown` if the software couldn't be detected.
name[RW]

@return [Symbol] The name of the network. `:unknown` if the

network couldn't be detected.

Public Class Methods

new(name, ircd) click to toggle source

@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

default_messages_per_second() click to toggle source

@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
default_server_queue_size() click to toggle source

@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
jtv?() click to toggle source

@return [Boolean] True if connected to JTV

# File lib/cinch/network.rb, line 62
def jtv?
  @name == :jtv
end
ngametv?() click to toggle source

@return [Boolean] True if connected to NgameTV

# File lib/cinch/network.rb, line 57
def ngametv?
  @name == :ngametv
end
owner_list_mode() click to toggle source

@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
quiet_list_mode() click to toggle source

@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
unknown_ircd?() click to toggle source

@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
unknown_network?() click to toggle source

@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
whois_only_one_argument?() click to toggle source

@return [Boolean] Does WHOIS only support one argument?

# File lib/cinch/network.rb, line 52
def whois_only_one_argument?
  @name == :jtv
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.