aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailbox/lib/action_mailbox/routing.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailbox/lib/action_mailbox/routing.rb')
-rw-r--r--actionmailbox/lib/action_mailbox/routing.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/actionmailbox/lib/action_mailbox/routing.rb b/actionmailbox/lib/action_mailbox/routing.rb
new file mode 100644
index 0000000000..1ea96c8a9d
--- /dev/null
+++ b/actionmailbox/lib/action_mailbox/routing.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+module ActionMailbox
+ # See `ActionMailbox::Base` for how to specify routing.
+ module Routing
+ extend ActiveSupport::Concern
+
+ included do
+ cattr_accessor :router, default: ActionMailbox::Router.new
+ end
+
+ class_methods do
+ def routing(routes)
+ router.add_routes(routes)
+ end
+
+ def route(inbound_email)
+ router.route(inbound_email)
+ end
+ end
+ end
+end