Class: ChatBot::GroupMeParser
- Inherits:
-
Object
- Object
- ChatBot::GroupMeParser
- Defined in:
- lib/chatbot/groupme_parser.rb
Class Method Summary collapse
Class Method Details
.parse(raw_message) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/chatbot/groupme_parser.rb', line 4 def self.parse() gm_msg = JSON.parse() if (gm_msg["name"].nil?) raise ArgumentError, "Invalid GroupMe message" end return GroupMeMessage.new(gm_msg["text"], gm_msg["name"], gm_msg["user_id"]) end |