Module: Bh::Helpers::Chats
- Included in:
- Bh::Helpers
- Defined in:
- lib/bh/helpers/chats.rb,
lib/bh/helpers/chats/asks.rb,
lib/bh/helpers/chats/asides.rb
Overview
A conversation drawn as the bubbles every Bh chat wears.
Defined Under Namespace
Constant Summary
Constants included from Asides
Asides::DELIVERIES, Asides::SIDES
Constants included from Asks
Instance Method Summary collapse
-
#chat_with(messages:, url: nil, hints: [], note: nil) ⇒ Object
messagesas a thread that opens at its newest and, whereurlis given, a field under it that posts the next message there, suggestinghintsone at a time.
Instance Method Details
#chat_with(messages:, url: nil, hints: [], note: nil) ⇒ Object
messages as a thread that opens at its newest and, where url is given, a field
under it that posts the next message there, suggesting hints one at a time. A
note stands over the whole thread: what this conversation is about, or the other
way to reach whoever is on the far end of it.
14 15 16 17 18 19 20 21 |
# File 'lib/bh/helpers/chats.rb', line 14 def chat_with(messages:, url: nil, hints: [], note: nil) parts = [bh_chat_note(note), ()] parts.push bh_chat_ask(url, hints) if url said = safe_join parts.compact, "\n" tag.div said, class: 'chat-thread', data: { controller: 'thread' } end |