Sha256: 38eed623fde30ad5f23294ece1a07d31f7b15dfafa9753fda8f8fd4dfdd301d4
Contents?: true
Size: 927 Bytes
Versions: 1
Compression:
Stored size: 927 Bytes
Contents
module Lita module Adapters class RingCentral < Adapter class Callback attr_reader :robot def initialize(robot) @robot = robot end def create_user(user_data) User.create user_data['phoneNumber'] end def update(message) Lita.logger.info 'Processing RingCentral Message' Lita.logger.info MultiJson.encode message user_phone_number = message['body']['from']['phoneNumber'] Lita.logger.info "Message received from #{user_phone_number}" user = Lita::User.find_by_name user_phone_number user = create_user(message['body']['from']) unless user source = Lita::Source.new user: user #, room: user_phone_number post = message['body']['subject'].to_s msg = Lita::Message.new @robot, post, source @robot.receive msg end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lita-ringcentral-0.0.2 | lib/lita/adapters/ringcentral/callback.rb |