Class: Krakow::Command::Sub
- Inherits:
-
Krakow::Command
- Object
- Krakow::Command
- Krakow::Command::Sub
- Defined in:
- lib/krakow/command/sub.rb
Overview
Subscribe to topic/channel
Instance Attribute Summary
Attributes inherited from Krakow::Command
Attributes collapse
-
#channel_name ⇒ String
The channel_name attribute.
-
#channel_name? ⇒ TrueClass, FalseClass
Truthiness of the channel_name 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
29 30 31 |
# File 'lib/krakow/command/sub.rb', line 29 def error %w(E_INVALID E_BAD_TOPIC E_BAD_CHANNEL) end |
.ok ⇒ Object
25 26 27 |
# File 'lib/krakow/command/sub.rb', line 25 def ok %w(OK) end |
Instance Method Details
#channel_name ⇒ String
Returns the channel_name attribute.
16 |
# File 'lib/krakow/command/sub.rb', line 16 attribute :channel_name, String, :required => true |
#channel_name? ⇒ TrueClass, FalseClass
Returns truthiness of the channel_name attribute.
16 |
# File 'lib/krakow/command/sub.rb', line 16 attribute :channel_name, String, :required => true |
#to_line ⇒ Object
20 21 22 |
# File 'lib/krakow/command/sub.rb', line 20 def to_line "#{name} #{topic_name} #{channel_name}\n" end |
#topic_name ⇒ String
Returns the topic_name attribute.
15 |
# File 'lib/krakow/command/sub.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/sub.rb', line 15 attribute :topic_name, String, :required => true |