Class: ChatSDK::GChat::EventParser

Inherits:
Object
  • Object
show all
Extended by:
ResourceName
Defined in:
lib/chat_sdk/gchat/event_parser.rb

Class Method Summary collapse

Methods included from ResourceName

extract_id

Class Method Details

.parse(payload) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/chat_sdk/gchat/event_parser.rb', line 9

def parse(payload)
  type = payload["type"]

  case type
  when "MESSAGE"
    parse_message(payload)
  when "CARD_CLICKED"
    parse_card_clicked(payload)
  when "ADDED_TO_SPACE", "REMOVED_FROM_SPACE"
    []
  else
    []
  end
end