Class: Krakow::Command::Auth

Inherits:
Krakow::Command show all
Defined in:
lib/krakow/command/auth.rb

Overview

Publish single message

Instance Attribute Summary

Attributes inherited from Krakow::Command

#response

Attributes collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Krakow::Command

#error?, #name, #ok?, response_for

Methods included from Utils::Lazy

included

Methods included from Utils::Logging

level=, #log

Class Method Details

.errorObject



29
30
31
# File 'lib/krakow/command/auth.rb', line 29

def error
  %w(E_AUTH_FAILED E_UNAUTHORIZED)
end

.okObject



25
26
27
# File 'lib/krakow/command/auth.rb', line 25

def ok
  %w(OK)
end

Instance Method Details

#secretString

Returns the secret attribute.

Returns:

  • (String)

    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.

Returns:

  • (TrueClass, FalseClass)

    truthiness of the secret attribute



15
# File 'lib/krakow/command/auth.rb', line 15

attribute :secret, String, :required => true

#to_lineObject



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