Class: Krakow::Command::Pub
- Inherits:
-
Krakow::Command
- Object
- Krakow::Command
- Krakow::Command::Pub
- Defined in:
- lib/krakow/command/pub.rb
Overview
Publish single message
Instance Attribute Summary (collapse)
-
- (Krakow::FrameType) response
inherited
from Krakow::Command
Response to command.
Attributes (collapse)
-
- (Object) message
The message attribute.
-
- (TrueClass, FalseClass) message?
Truthiness of the message attribute.
-
- (String) topic_name
The topic_name attribute.
-
- (TrueClass, FalseClass) topic_name?
Truthiness of the topic_name attribute.
Class Method Summary (collapse)
Instance Method Summary (collapse)
Instance Attribute Details
- (Krakow::FrameType) response Originally defined in class Krakow::Command
Returns response to command
Class Method Details
+ (Object) error
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 |
+ (Object) ok
26 27 28 |
# File 'lib/krakow/command/pub.rb', line 26 def ok %w(OK) end |
Instance Method Details
- (Object) message
Returns the message attribute
16 |
# File 'lib/krakow/command/pub.rb', line 16 attribute :message, Object, :required => true |
- (TrueClass, FalseClass) message?
Returns truthiness of the message attribute
16 |
# File 'lib/krakow/command/pub.rb', line 16 attribute :message, Object, :required => true |
- (Object) to_line
20 21 22 23 |
# File 'lib/krakow/command/pub.rb', line 20 def to_line msg = .to_s [name, ' ', topic_name, "\n", msg.length, msg].pack('a*a*a*a*l>a*') end |
- (String) topic_name
Returns the topic_name attribute
15 |
# File 'lib/krakow/command/pub.rb', line 15 attribute :topic_name, String, :required => true |
- (TrueClass, FalseClass) topic_name?
Returns truthiness of the topic_name attribute
15 |
# File 'lib/krakow/command/pub.rb', line 15 attribute :topic_name, String, :required => true |