From 955739e2a7be70e6abf7e95710ffe0f4a9c64481 Mon Sep 17 00:00:00 2001 From: mms Date: Tue, 12 Nov 2024 21:26:10 +0100 Subject: feat: rename modules --- lib/osugiru/message.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/osugiru/message.rb (limited to 'lib/osugiru/message.rb') diff --git a/lib/osugiru/message.rb b/lib/osugiru/message.rb new file mode 100644 index 0000000..3446f17 --- /dev/null +++ b/lib/osugiru/message.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Osugiru + class Message + attr_reader :message + + def initialize(msg:) + @message = msg + end + + def method_missing(method_name, *_args) + handle_get(Osugiru::Helpers.header_name_from_dsl(method_name)) + end + + def handle_get(header_name) + message.header(header_name) if message.header(header_name) + end + + def tags + @message.tags + end + end +end -- cgit v1.2.3