Class: Krakow::Command::Sub

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

Overview

Subscribe to topic/channel

Instance Attribute Summary

Attributes inherited from Krakow::Command

#response

Attributes collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Krakow::Command

#error?, #name, #ok?, response_for

Methods included from Utils::Lazy

included

Methods included from Utils::Logging

level=, #log

Class Method Details

.errorObject



29
30
31
# File 'lib/krakow/command/sub.rb', line 29

def error
  %w(E_INVALID E_BAD_TOPIC E_BAD_CHANNEL)
end

.okObject



25
26
27
# File 'lib/krakow/command/sub.rb', line 25

def ok
  %w(OK)
end

Instance Method Details

#channel_nameString

Returns the channel_name attribute.

Returns:

  • (String)

    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.

Returns:

  • (TrueClass, FalseClass)

    truthiness of the channel_name attribute



16
# File 'lib/krakow/command/sub.rb', line 16

attribute :channel_name, String, :required => true

#to_lineObject



20
21
22
# File 'lib/krakow/command/sub.rb', line 20

def to_line
  "#{name} #{topic_name} #{channel_name}\n"
end

#topic_nameString

Returns the topic_name attribute.

Returns:

  • (String)

    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.

Returns:

  • (TrueClass, FalseClass)

    truthiness of the topic_name attribute



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

attribute :topic_name, String, :required => true