Class: Krakow::Command::Pub

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

Overview

Publish single message

Instance Attribute Summary (collapse)

Attributes (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Krakow::FrameType) response Originally defined in class Krakow::Command

Returns response to command

Returns:

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

Returns:

  • (Object)

    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

Returns:

  • (TrueClass, FalseClass)

    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 = message.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

Returns:

  • (String)

    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

Returns:

  • (TrueClass, FalseClass)

    truthiness of the topic_name attribute



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

attribute :topic_name, String, :required => true