Class: Krakow::Command::Auth
- Inherits:
-
Krakow::Command
- Object
- Krakow::Command
- Krakow::Command::Auth
- Defined in:
- lib/krakow/command/auth.rb
Overview
Publish single message
Instance Attribute Summary
Attributes inherited from Krakow::Command
Attributes collapse
-
#secret ⇒ String
The secret attribute.
-
#secret? ⇒ TrueClass, FalseClass
Truthiness of the secret attribute.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Krakow::Command
#error?, #name, #ok?, response_for
Methods included from Utils::Lazy
Methods included from Utils::Logging
Class Method Details
.error ⇒ Object
29 30 31 |
# File 'lib/krakow/command/auth.rb', line 29 def error %w(E_AUTH_FAILED E_UNAUTHORIZED) end |
.ok ⇒ Object
25 26 27 |
# File 'lib/krakow/command/auth.rb', line 25 def ok %w(OK) end |
Instance Method Details
#secret ⇒ String
Returns the secret attribute.
15 |
# File 'lib/krakow/command/auth.rb', line 15 attribute :secret, String, :required => true |
#secret? ⇒ TrueClass, FalseClass
Returns truthiness of the secret attribute.
15 |
# File 'lib/krakow/command/auth.rb', line 15 attribute :secret, String, :required => true |
#to_line ⇒ Object
19 20 21 22 |
# File 'lib/krakow/command/auth.rb', line 19 def to_line scrt = secret.to_s [name, "\n", scrt.bytesize, scrt].pack('a*a*a*a*l>a*') end |