Class: WampRails::Command::Register

Inherits:
BaseHandler show all
Defined in:
lib/wamp_rails/commands/register.rb

Instance Attribute Summary collapse

Attributes inherited from BaseHandler

#klass

Attributes inherited from BaseCommand

#client, #queue

Instance Method Summary collapse

Methods inherited from BaseHandler

#handler

Methods inherited from BaseCommand

#callback, #session

Constructor Details

#initialize(procedure, klass, options, client) ⇒ Register

Returns a new instance of Register.



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

def initialize(procedure, klass, options, client)
  super(client, klass)
  self.procedure = procedure
  self.options = options

  unless self.klass < WampRails::Controller::Procedure
    raise WampRails::Error.new('klass must be a WampRails::Controller::Procedure class')
  end
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/wamp_rails/commands/register.rb', line 4

def options
  @options
end

#procedureObject

Returns the value of attribute procedure.



4
5
6
# File 'lib/wamp_rails/commands/register.rb', line 4

def procedure
  @procedure
end

Instance Method Details

#executeObject



16
17
18
19
20
# File 'lib/wamp_rails/commands/register.rb', line 16

def execute
  session.register(procedure, handler, options) do |result, error, details|
    self.callback(result, error, details)
  end
end