diff options
author | mms <git@sapka.me> | 2024-11-10 00:20:05 +0100 |
---|---|---|
committer | mms <git@sapka.me> | 2024-11-10 00:20:05 +0100 |
commit | 68d7eb07d88338f28c40a5ba68061a7f4e35f340 (patch) | |
tree | 7c1e0ab62ff2a2d9cd89ae1bd113759bb3077f13 /lib/some/ruleset.rb | |
parent | 2b84ba48039818cf52f6acf3c06610212bf6f7c5 (diff) |
feat: dsl
Diffstat (limited to 'lib/some/ruleset.rb')
-rw-r--r-- | lib/some/ruleset.rb | 11 |
1 files changed, 11 insertions, 0 deletions
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 |