Class: IRC::Commands::PasswordCommand
- Defined in:
- lib/irc/commands/password_command.rb
Overview
4.1.1 Password message
Command: PASS Parameters: <password>
The PASS command is used to set a ‘connection password’. The password can and must be set before any attempt to register the connection is made. Currently this requires that clients send a PASS command before sending the NICK/USER combination and servers must send a PASS command before any SERVER command. The password supplied must match the one contained in the C/N lines (for servers) or I lines (for clients). It is possible to send multiple PASS commands before registering but only the last one sent is used for verification and it may not be changed once registered.
Numeric Replies:
ERR_NEEDMOREPARAMS ERR_ALREADYREGISTRED
Example:
PASS secretpasswordhere
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
Returns the value of attribute password.
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(password) ⇒ PasswordCommand
constructor
A new instance of PasswordCommand.
Methods inherited from Command
Constructor Details
#initialize(password) ⇒ PasswordCommand
Returns a new instance of PasswordCommand.
59 60 61 62 |
# File 'lib/irc/commands/password_command.rb', line 59 def initialize(password) raise InvalidCommand.new("Can't create password command. No password.") unless password @password = password end |
Instance Attribute Details
#password ⇒ Object (readonly)
Returns the value of attribute password.
57 58 59 |
# File 'lib/irc/commands/password_command.rb', line 57 def password @password end |
Instance Method Details
#command ⇒ Object
64 65 66 |
# File 'lib/irc/commands/password_command.rb', line 64 def command return "PASS #{password}" end |