Class: WampRails::Command::Publish

Inherits:
BaseCommand show all
Defined in:
lib/wamp_rails/commands/publish.rb

Instance Attribute Summary collapse

Attributes inherited from BaseCommand

#client, #queue

Instance Method Summary collapse

Methods inherited from BaseCommand

#callback, #session

Constructor Details

#initialize(topic, args, kwargs, options, client) ⇒ Publish

Returns a new instance of Publish.



7
8
9
10
11
12
13
# File 'lib/wamp_rails/commands/publish.rb', line 7

def initialize(topic, args, kwargs, options, client)
  super(client)
  self.topic = topic
  self.args = args
  self.kwargs = kwargs
  self.options = options
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



5
6
7
# File 'lib/wamp_rails/commands/publish.rb', line 5

def args
  @args
end

#kwargsObject

Returns the value of attribute kwargs.



5
6
7
# File 'lib/wamp_rails/commands/publish.rb', line 5

def kwargs
  @kwargs
end

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'lib/wamp_rails/commands/publish.rb', line 5

def options
  @options
end

#topicObject

Returns the value of attribute topic.



5
6
7
# File 'lib/wamp_rails/commands/publish.rb', line 5

def topic
  @topic
end

Instance Method Details

#executeObject



15
16
17
18
19
# File 'lib/wamp_rails/commands/publish.rb', line 15

def execute
  session.publish(topic, args, kwargs, options) do |result, error, details|
    self.callback(result, error, details)
  end
end