1 2 3 4 5 6 7 8 9 10 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