Module: Mailer::Config
- Included in:
- Mailer
- Defined in:
- lib/mailer/config.rb
Constant Summary collapse
- DEFAULT_API_DOMAIN =
Defaultapi domain
'http://127.0.0.1:80/api/'
- DEFAULT_API_TOKEN =
Defailt api token
nil
- VALID_OPTIONS_KEYS =
Valid options keys
[ :api_token, :api_domain ]
Class Method Summary collapse
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
-
#options ⇒ Hash
Create a hash of options and their values.
-
#reset ⇒ self
Reset config.
Class Method Details
.extended(base) ⇒ Object
19 20 21 |
# File 'lib/mailer/config.rb', line 19 def self.extended(base) base.reset end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
23 24 25 26 |
# File 'lib/mailer/config.rb', line 23 def configure yield self self end |
#options ⇒ Hash
Create a hash of options and their values
31 32 33 34 35 |
# File 'lib/mailer/config.rb', line 31 def = {} VALID_OPTIONS_KEYS.each{|k| [k] = send(k)} end |
#reset ⇒ self
Reset config
40 41 42 43 44 |
# File 'lib/mailer/config.rb', line 40 def reset self.api_token = DEFAULT_API_TOKEN self.api_domain = DEFAULT_API_DOMAIN self end |