diff options
author | George Claghorn <george@basecamp.com> | 2018-10-17 12:38:26 -0400 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-10-17 12:38:26 -0400 |
commit | 7903e3ada80d7938b1b78b06d0f678e95367a56b (patch) | |
tree | e386dade1d79a56ca0d84e7af347596a24ae1d03 /lib | |
parent | 89ada1977ce648b2121cad7cfb95af9686ea016b (diff) | |
download | rails-7903e3ada80d7938b1b78b06d0f678e95367a56b.tar.gz rails-7903e3ada80d7938b1b78b06d0f678e95367a56b.tar.bz2 rails-7903e3ada80d7938b1b78b06d0f678e95367a56b.zip |
Use a class attribute
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action_mailbox/routing.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/action_mailbox/routing.rb b/lib/action_mailbox/routing.rb index b40e2774e4..d258b632f9 100644 --- a/lib/action_mailbox/routing.rb +++ b/lib/action_mailbox/routing.rb @@ -2,15 +2,17 @@ module ActionMailbox module Routing extend ActiveSupport::Concern - class_methods do - attr_reader :router + included do + cattr_accessor :router, default: ActionMailbox::Router.new + end + class_methods do def routing(routes) - (@router ||= ActionMailbox::Router.new).add_routes(routes) + router.add_routes(routes) end def route(inbound_email) - @router.route(inbound_email) + router.route(inbound_email) end end end |