Class: RocketChat::Realtime::Messages::Subscribe

Inherits:
RocketChat::Realtime::Message show all
Defined in:
lib/rocket_chat/realtime/messages/subscribe.rb

Overview

The subscribe message

The DDP subscribe message

Since:

  • 0.1.0

Instance Attribute Summary collapse

Attributes inherited from RocketChat::Realtime::Message

#id, #type

Instance Method Summary collapse

Methods inherited from RocketChat::Realtime::Message

#to_json

Constructor Details

#initialize(name, *parameters) ⇒ Subscribe

Returns a new instance of Subscribe.

Parameters:

  • args (Array)

    the parameters for method

Since:

  • 0.1.0



18
19
20
21
22
23
# File 'lib/rocket_chat/realtime/messages/subscribe.rb', line 18

def initialize(name, *parameters)
  super('sub')

  @name = name
  @parameters = parameters
end

Instance Attribute Details

#nameObject (readonly)

Since:

  • 0.1.0



15
16
17
# File 'lib/rocket_chat/realtime/messages/subscribe.rb', line 15

def name
  @name
end

#parametersObject (readonly)

Since:

  • 0.1.0



15
16
17
# File 'lib/rocket_chat/realtime/messages/subscribe.rb', line 15

def parameters
  @parameters
end

Instance Method Details

#bodyObject

See Also:

Since:

  • 0.1.0



28
29
30
31
32
33
# File 'lib/rocket_chat/realtime/messages/subscribe.rb', line 28

def body
  {
    name: name,
    params: parameters
  }
end