Class: Slanger::Api::Event
- Inherits:
-
Struct
- Object
- Struct
- Slanger::Api::Event
- Defined in:
- lib/slanger/api/event.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#name ⇒ Object
Returns the value of attribute name.
-
#socket_id ⇒ Object
Returns the value of attribute socket_id.
Instance Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data
5 6 7 |
# File 'lib/slanger/api/event.rb', line 5 def data @data end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'lib/slanger/api/event.rb', line 5 def name @name end |
#socket_id ⇒ Object
Returns the value of attribute socket_id
5 6 7 |
# File 'lib/slanger/api/event.rb', line 5 def socket_id @socket_id end |
Instance Method Details
#payload(channel_id) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/slanger/api/event.rb', line 6 def payload(channel_id) Oj.dump({ event: name, data: data, channel: channel_id, socket_id: socket_id, }.select { |_, v| v }, mode: :compat) end |