Class: Krakow::Command::Mpub
- Inherits:
-
Krakow::Command
- Object
- Krakow::Command
- Krakow::Command::Mpub
- Defined in:
- lib/krakow/command/mpub.rb
Overview
Publish multiple messages
Instance Attribute Summary
Attributes inherited from Krakow::Command
Attributes collapse
-
#messages ⇒ Array
The messages attribute.
-
#messages? ⇒ TrueClass, FalseClass
Truthiness of the messages attribute.
-
#topic_name ⇒ String
The topic_name attribute.
-
#topic_name? ⇒ TrueClass, FalseClass
Truthiness of the topic_name 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
32 33 34 |
# File 'lib/krakow/command/mpub.rb', line 32 def error %w(E_INVALID E_BAD_TOPIC E_BAD_BODY E_BAD_MESSAGE E_MPUB_FAILED) end |
.ok ⇒ Object
28 29 30 |
# File 'lib/krakow/command/mpub.rb', line 28 def ok %w(OK) end |
Instance Method Details
#messages ⇒ Array
Returns the messages attribute.
16 |
# File 'lib/krakow/command/mpub.rb', line 16 attribute :messages, Array, :required => true |
#messages? ⇒ TrueClass, FalseClass
Returns truthiness of the messages attribute.
16 |
# File 'lib/krakow/command/mpub.rb', line 16 attribute :messages, Array, :required => true |
#to_line ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/krakow/command/mpub.rb', line 19 def to_line = .map do || = .to_s [.bytesize, ].pack('l>a*') end.join [name, ' ', topic_name, "\n", .bytesize, .size, ].pack('a*a*a*a*l>l>a*') end |
#topic_name ⇒ String
Returns the topic_name attribute.
15 |
# File 'lib/krakow/command/mpub.rb', line 15 attribute :topic_name, String, :required => true |
#topic_name? ⇒ TrueClass, FalseClass
Returns truthiness of the topic_name attribute.
15 |
# File 'lib/krakow/command/mpub.rb', line 15 attribute :topic_name, String, :required => true |