Class: WampRails::Command::BaseHandler

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

Direct Known Subclasses

Register, Subscribe

Instance Attribute Summary collapse

Attributes inherited from BaseCommand

#client, #queue

Instance Method Summary collapse

Methods inherited from BaseCommand

#callback, #execute, #session

Constructor Details

#initialize(client, klass) ⇒ BaseHandler

Returns a new instance of BaseHandler.



13
14
15
16
# File 'lib/wamp_rails/commands/base_handler.rb', line 13

def initialize(client, klass)
  super(client)
  self.klass = klass
end

Instance Attribute Details

#klassObject

Returns the value of attribute klass.



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

def klass
  @klass
end

Instance Method Details

#handlerObject



6
7
8
9
10
11
# File 'lib/wamp_rails/commands/base_handler.rb', line 6

def handler
  lambda { |args, kwargs, details|
    object = klass.new(args, kwargs, details, client)
    object.handler
  }
end