From 68d7eb07d88338f28c40a5ba68061a7f4e35f340 Mon Sep 17 00:00:00 2001 From: mms Date: Sun, 10 Nov 2024 00:20:05 +0100 Subject: feat: dsl --- lib/some/ruleset.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lib/some/ruleset.rb (limited to 'lib/some/ruleset.rb') diff --git a/lib/some/ruleset.rb b/lib/some/ruleset.rb new file mode 100644 index 0000000..6df1eff --- /dev/null +++ b/lib/some/ruleset.rb @@ -0,0 +1,11 @@ +module Some + RuleSet = Struct.new(:name, :rule) do + def messages + Messages.new(db: Some.db) + end + + def run + instance_eval(&rule) + end + end +end -- cgit v1.2.3