Module: SmtpLw::Configurable

Included in:
SmtpLw
Defined in:
lib/smtp_lw/configurable.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_endpointString

Base endpoint URL for generated web URLs Referenced by SmtpLw.api_endpoint

Returns:



23
24
25
# File 'lib/smtp_lw/configurable.rb', line 23

def api_endpoint
  @api_endpoint
end

#api_tokenObject

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_pageObject

Returns the value of attribute per_page.



3
4
5
# File 'lib/smtp_lw/configurable.rb', line 3

def per_page
  @per_page
end

#timeoutObject

Returns the value of attribute timeout.



3
4
5
# File 'lib/smtp_lw/configurable.rb', line 3

def timeout
  @timeout
end

Class Method Details

.keysObject



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

Yields:

  • (_self)

Yield Parameters:



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.options[key])
  end
  self
end