Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request Uber::Configuration #13

Open
timoschilling opened this issue Nov 7, 2015 · 0 comments
Open

feature request Uber::Configuration #13

timoschilling opened this issue Nov 7, 2015 · 0 comments

Comments

@timoschilling
Copy link
Contributor

Some lines of code, saying more then 1000 words.

module Cells::Mailer::Config
  include Uber::Configuration
  configuration_name :mailer
  configuration_instance_name :mailer_config
  configuration_options :from, :to, :subject
end

module Cells::Mailer
  include Cells::Mailer::Config
end

class ApplicationMailerCell
  include Cells::Mailer
  mailer do
    from "[email protected]"
  end
end

class FooMailerCell < ApplicationMailerCell
  mailer do
    subject "Foo"
    # `from` will be inherit from ApplicationMailerCell
  end

  def deliver
    mailer_config # => {from: "[email protected]", subject: "Foo"}
    mailer_config.from # => "[email protected]"
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant