Class: RocketChat::Realtime::Messages::Changed
- Inherits:
-
RocketChat::Realtime::Message
- Object
- RocketChat::Realtime::Message
- RocketChat::Realtime::Messages::Changed
- Defined in:
- lib/rocket_chat/realtime/messages/changed.rb
Overview
The changed message
The DDP subscription changed message
Instance Attribute Summary collapse
- #cleared ⇒ Object readonly
- #collection ⇒ Object readonly
- #fields ⇒ Object readonly
Attributes inherited from RocketChat::Realtime::Message
Instance Method Summary collapse
-
#[](key) ⇒ Object
:nodoc:.
- #body ⇒ Object
-
#initialize(id, message) ⇒ Changed
constructor
A new instance of Changed.
Methods inherited from RocketChat::Realtime::Message
Constructor Details
#initialize(id, message) ⇒ Changed
Returns a new instance of Changed.
18 19 20 21 22 23 24 |
# File 'lib/rocket_chat/realtime/messages/changed.rb', line 18 def initialize(id, ) super('changed', id) @fields = .fetch('fields', nil) @cleared = .fetch('cleared', nil) @collection = .fetch('collection', nil) end |
Instance Attribute Details
#cleared ⇒ Object (readonly)
15 16 17 |
# File 'lib/rocket_chat/realtime/messages/changed.rb', line 15 def cleared @cleared end |
#collection ⇒ Object (readonly)
15 16 17 |
# File 'lib/rocket_chat/realtime/messages/changed.rb', line 15 def collection @collection end |
#fields ⇒ Object (readonly)
15 16 17 |
# File 'lib/rocket_chat/realtime/messages/changed.rb', line 15 def fields @fields end |
Instance Method Details
#[](key) ⇒ Object
:nodoc:
38 39 40 |
# File 'lib/rocket_chat/realtime/messages/changed.rb', line 38 def [](key) fields.fetch(key.to_s, nil) end |
#body ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/rocket_chat/realtime/messages/changed.rb', line 29 def body { fields: fields, cleared: cleared, collection: collection } end |