Sha256: 82bd4a58657a640084af4b7df466d364d1c72bdfefcb969915e209bcfb096a62
Contents?: true
Size: 675 Bytes
Versions: 28
Compression:
Stored size: 675 Bytes
Contents
module Lifen class Message < Base attribute :uuid, String attribute :content, String attribute :type, String, default: "regular" attribute :flow, Lifen::Flow attribute :sent_at, DateTime def create json = client.post("central/api/chats/#{flow.uuid}/messages", {content: content, type: type}) json["sent_at"] = json["sentDate"] message = self.class.new(json) self.flow = flow self.uuid = message.uuid self.content = message.content self.type = message.type self.sent_at = message.sent_at self end private def client @client ||= flow.user.client end end end
Version data entries
28 entries across 28 versions & 1 rubygems