aboutsummaryrefslogblamecommitdiffstats
path: root/actionmailbox/lib/action_mailbox/routing.rb
blob: 1ea96c8a9d91eedd18e73fc26663707baf2d0731 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                             
                    
                                                         


                                 


                                                                
 
                    
                         
                                 


                              
                                   



         
# 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