Class: ActiveNotifier::Base::Configuration
- Inherits:
-
Object
- Object
- ActiveNotifier::Base::Configuration
- Defined in:
- lib/active_notifier/base.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #method_missing(*args, &blk) ⇒ Object
- #respond_to?(*args, &blk) ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
62 63 64 65 66 67 68 69 |
# File 'lib/active_notifier/base.rb', line 62 def initialize @data = { from: nil, email_attribute: nil, subject: nil, superclass: ActionMailer::Base } end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &blk) ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/active_notifier/base.rb', line 73 def method_missing(*args, &blk) attribute, value = args if value.present? @data[attribute] = value elsif block_given? @data[attribute] = blk else @data.fetch attribute do super end end end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
60 61 62 |
# File 'lib/active_notifier/base.rb', line 60 def data @data end |
Instance Method Details
#respond_to?(*args, &blk) ⇒ Boolean
86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/active_notifier/base.rb', line 86 def respond_to?(*args, &blk) attribute, value = args if value.present? true elsif block_given? true else @data.fetch attribute do super end end end |