8000 feature request Uber::Configuration · Issue #13 · apotonick/uber · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
feature request Uber::Configuration #13
Open
@timoschilling

Description

@timoschilling

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 "admin@project.com"
  end
end

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

  def deliver
    mailer_config # => {from: "admin@project.com", subject: "Foo"}
    mailer_config.from # => "admin@project.com"
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0