Module: Teems::Services::SyncChatWrite
- Included in:
- SyncStore
- Defined in:
- lib/teems/services/sync_store.rb
Overview
Chat file write operations for SyncStore
Instance Method Summary collapse
- #write_chat_metadata(chat_id, metadata, state: nil) ⇒ Object
- #write_messages(chat_id, **opts) ⇒ Object
Instance Method Details
#write_chat_metadata(chat_id, metadata, state: nil) ⇒ Object
108 109 110 111 |
# File 'lib/teems/services/sync_store.rb', line 108 def (chat_id, , state: nil) dir = chat_dir(chat_id, state: state) write_to_dir(dir, 'chat_metadata.json' => JSON.pretty_generate()) end |
#write_messages(chat_id, **opts) ⇒ Object
102 103 104 105 106 |
# File 'lib/teems/services/sync_store.rb', line 102 def (chat_id, **opts) md, json, state = opts.values_at(:messages_md, :messages_json, :state) write_to_dir(chat_dir(chat_id, state: state), 'messages.md' => md, 'messages.json' => json) end |