Class: RocketChat::Realtime::Handlers::Base

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/rocket_chat/realtime/handlers/base.rb

Overview

Base Message Handler

Since:

  • 0.1.0

Direct Known Subclasses

Changed, Ready, Result

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dispatcher, message) ⇒ Base

Returns a new instance of Base.

Parameters:

Since:

  • 0.1.0



38
39
40
41
# File 'lib/rocket_chat/realtime/handlers/base.rb', line 38

def initialize(dispatcher, message)
  @dispatcher = dispatcher
  @message = message
end

Instance Attribute Details

#dispatcherObject (readonly)

Since:

  • 0.1.0



29
30
31
# File 'lib/rocket_chat/realtime/handlers/base.rb', line 29

def dispatcher
  @dispatcher
end

#messageObject (readonly)

Since:

  • 0.1.0



29
30
31
# File 'lib/rocket_chat/realtime/handlers/base.rb', line 29

def message
  @message
end

Class Method Details

.call(dispatcher, message) ⇒ Object

Dispatch message

Parameters:

Since:

  • 0.1.0



21
22
23
# File 'lib/rocket_chat/realtime/handlers/base.rb', line 21

def call(dispatcher, message)
  new(dispatcher, message).process
end

Instance Method Details

#processObject

Process message

Raises:

  • (NotImplementedError)

Since:

  • 0.1.0



46
47
48
# File 'lib/rocket_chat/realtime/handlers/base.rb', line 46

def process
  raise NotImplementedError
end