module Mailer
class << self
attr_accessor :configuration
def configure
self.configuration ||= Configuration.new
yield(configuration)
end
end
class Configuration
attr_accessor :sender_mailer
def def initialize
@sender_mailer = '[email protected]'
end
end
end
Mailer.configure do |config|
config.sender_mailer = '[email protected]'
end
Mailer.configuration.sender_mailer => '[email protected]'
近期评论