1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionmailbox/lib/action_mailbox/routing.rb

27 lines
529 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module ActionMailbox
# See +ActionMailbox::Base+ for how to specify routing.
module Routing
extend ActiveSupport::Concern
2018-10-17 12:38:26 -04:00
included do
cattr_accessor :router, default: ActionMailbox::Router.new
end
2018-10-17 12:38:26 -04:00
class_methods do
def routing(routes)
2018-10-17 12:38:26 -04:00
router.add_routes(routes)
end
def route(inbound_email)
2018-10-17 12:38:26 -04:00
router.route(inbound_email)
end
def mailbox_for(inbound_email)
router.mailbox_for(inbound_email)
end
end
end
end