Files
bbs-server/lib/service/message_service.rb
2026-05-12 20:23:30 +02:00

15 lines
308 B
Ruby

# frozen_string_literal: true
class MessageService
def initialize(repo) = @repo = repo
def recent(count = 30) = @repo.last(count)
def count = @repo.count
def post(username, text)
return :empty if text.strip.empty?
@repo.append(username, text.strip[0...200])
:ok
end
end