Class: WampRails::Command::Call

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

Instance Attribute Summary collapse

Attributes inherited from BaseCommand

#client, #queue

Instance Method Summary collapse

Methods inherited from BaseCommand

#callback, #session

Constructor Details

#initialize(procedure, args, kwargs, options, client) ⇒ Call

Returns a new instance of Call.



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

def initialize(procedure, args, kwargs, options, client)
  super(client)
  self.procedure = procedure
  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/call.rb', line 5

def args
  @args
end

#kwargsObject

Returns the value of attribute kwargs.



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

def kwargs
  @kwargs
end

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end

#procedureObject

Returns the value of attribute procedure.



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

def procedure
  @procedure
end

Instance Method Details

#executeObject



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

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