class Chatbox::Draft

Attributes

body[R]
from[R]
store[R]
to[R]

Public Class Methods

new(from: req(:from), to: req(:to), body: req(:body), store: req(:store)) click to toggle source
# File lib/chatbox/draft.rb, line 7
def initialize(from: req(:from), to: req(:to), body: req(:body), store: req(:store))
  @from = from
  @to = to
  @body = body
  @store = store
end

Public Instance Methods

deliver!() click to toggle source
# File lib/chatbox/draft.rb, line 14
def deliver!
  store.add_message from_id: from.chatbox_id, to_id: to.chatbox_id, body: body
end