Class: MailEnvi::Config
- Inherits:
-
Object
- Object
- MailEnvi::Config
- Defined in:
- lib/mail_envi/config.rb
Instance Attribute Summary collapse
-
#default_to ⇒ Object
Returns the value of attribute default_to.
-
#environments ⇒ Object
readonly
Returns the value of attribute environments.
-
#interceptor ⇒ Object
Returns the value of attribute interceptor.
Class Method Summary collapse
Instance Method Summary collapse
- #include_environments(envs = []) ⇒ Object
-
#initialize(&block) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(&block) ⇒ Config
Returns a new instance of Config.
13 14 15 16 |
# File 'lib/mail_envi/config.rb', line 13 def initialize &block @environments = ['development'] instance_eval(&block) if block_given? end |
Instance Attribute Details
#default_to ⇒ Object
Returns the value of attribute default_to.
18 19 20 |
# File 'lib/mail_envi/config.rb', line 18 def default_to @default_to end |
#environments ⇒ Object (readonly)
Returns the value of attribute environments.
19 20 21 |
# File 'lib/mail_envi/config.rb', line 19 def environments @environments end |
#interceptor ⇒ Object
Returns the value of attribute interceptor.
18 19 20 |
# File 'lib/mail_envi/config.rb', line 18 def interceptor @interceptor end |
Class Method Details
.instance ⇒ Object
4 5 6 |
# File 'lib/mail_envi/config.rb', line 4 def instance @instance end |
.set(&block) ⇒ Object
8 9 10 |
# File 'lib/mail_envi/config.rb', line 8 def set(&block) @instance = new(&block) end |
Instance Method Details
#include_environments(envs = []) ⇒ Object
25 26 27 |
# File 'lib/mail_envi/config.rb', line 25 def include_environments(envs = []) @environments+= envs.map(&:to_s) if envs && envs.any? end |