Class: RocketChat::Realtime::Messages::Result

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

Overview

The result message

The DDP RPC result 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(id, result) ⇒ Result

Returns a new instance of Result.

Parameters:

  • args (Array)

    the parameters for method

Since:

  • 0.1.0



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

def initialize(id, result)
  super('result', id)

  @result = result
end

Instance Attribute Details

#resultObject (readonly)

Since:

  • 0.1.0



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

def result
  @result
end

Instance Method Details

#[](key) ⇒ Object

:nodoc:

Since:

  • 0.1.0



34
35
36
# File 'lib/rocket_chat/realtime/messages/result.rb', line 34

def [](key)
  result.fetch(key.to_s, nil)
end

#bodyObject

See Also:

Since:

  • 0.1.0



27
28
29
30
31
# File 'lib/rocket_chat/realtime/messages/result.rb', line 27

def body
  {
    result: result
  }
end