aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_mailbox/routing.rb
blob: b40e2774e4ce6c33332dcc6dc9eda801a4fbb052 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module ActionMailbox
  module Routing
    extend ActiveSupport::Concern

    class_methods do
      attr_reader :router

      def routing(routes)
        (@router ||= ActionMailbox::Router.new).add_routes(routes)
      end

      def route(inbound_email)
        @router.route(inbound_email)
      end
    end
  end
end