Module: SmtpLw::Configurable
- Included in:
- SmtpLw
- Defined in:
- lib/smtp_lw/configurable.rb
Instance Attribute Summary collapse
-
#api_endpoint ⇒ String
Base endpoint URL for generated web URLs Referenced by SmtpLw.api_endpoint.
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#per_page ⇒ Object
Returns the value of attribute per_page.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Class Method Summary collapse
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Set configuration options using a block.
- #reset! ⇒ Object
Instance Attribute Details
#api_endpoint ⇒ String
Base endpoint URL for generated web URLs Referenced by SmtpLw.api_endpoint
23 24 25 |
# File 'lib/smtp_lw/configurable.rb', line 23 def api_endpoint @api_endpoint end |
#api_token ⇒ Object
Returns the value of attribute api_token.
3 4 5 |
# File 'lib/smtp_lw/configurable.rb', line 3 def api_token @api_token end |
#per_page ⇒ Object
Returns the value of attribute per_page.
3 4 5 |
# File 'lib/smtp_lw/configurable.rb', line 3 def per_page @per_page end |
#timeout ⇒ Object
Returns the value of attribute timeout.
3 4 5 |
# File 'lib/smtp_lw/configurable.rb', line 3 def timeout @timeout end |
Class Method Details
.keys ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/smtp_lw/configurable.rb', line 6 def keys @keys ||= [ :api_token, :api_endpoint, :per_page, :timeout ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Set configuration options using a block
36 37 38 |
# File 'lib/smtp_lw/configurable.rb', line 36 def configure yield self end |
#reset! ⇒ Object
40 41 42 43 44 45 |
# File 'lib/smtp_lw/configurable.rb', line 40 def reset! SmtpLw::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", SmtpLw::Default.[key]) end self end |