Class: Krakow::Command::Pub
Overview
Instance Attribute Summary
#response
Class Method Summary
collapse
Instance Method Summary
collapse
#error?, #name, #ok?, response_for
included
level=, #log
Class Method Details
.error ⇒ Object
30
31
32
|
# File 'lib/krakow/command/pub.rb', line 30
def error
%w(E_INVALID E_BAD_TOPIC E_BAD_MESSAGE E_PUB_FAILED)
end
|
.ok ⇒ Object
26
27
28
|
# File 'lib/krakow/command/pub.rb', line 26
def ok
%w(OK)
end
|
Instance Method Details
#message ⇒ Object
16
|
# File 'lib/krakow/command/pub.rb', line 16
attribute :message, Object, :required => true
|
#message? ⇒ TrueClass, FalseClass
16
|
# File 'lib/krakow/command/pub.rb', line 16
attribute :message, Object, :required => true
|
#to_line ⇒ Object
20
21
22
23
|
# File 'lib/krakow/command/pub.rb', line 20
def to_line
msg = message.to_s
[name, ' ', topic_name, "\n", msg.bytesize, msg].pack('a*a*a*a*l>a*')
end
|
#topic_name ⇒ String
15
|
# File 'lib/krakow/command/pub.rb', line 15
attribute :topic_name, String, :required => true
|
#topic_name? ⇒ TrueClass, FalseClass
15
|
# File 'lib/krakow/command/pub.rb', line 15
attribute :topic_name, String, :required => true
|