Class: Chatbox::Draft

Inherits:
Object
  • Object
show all
Includes:
FakeMissingKeywords
Defined in:
lib/chatbox/draft.rb

Instance Method Summary collapse

Methods included from FakeMissingKeywords

#req

Constructor Details

#initialize(from: req(:from), to: req(:to), body: req(:body), store: req(:store)) ⇒ Draft

Returns a new instance of Draft.



7
8
9
10
11
12
# 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

Instance Method Details

#deliver!Object



14
15
16
# 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