Class: Emailverify::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/emailverify/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/emailverify/configuration.rb', line 8

def initialize
  @api_key = nil
  # Base URL is fixed to the official EmailVerify.io host
  @base_url = "https://app.emailverify.io"
  @timeout = 10
  @logger = nil
  # endpoints can be overridden by the user to match their API paths
  @endpoints = {
    # EmailVerify.io single email validation endpoint (v1)
    validate: "/api/v1/validate",
    # EmailVerify.io check account balance endpoint (v2)
    check_balance: "/api/v2/check-account-balance"
  }
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



5
6
7
# File 'lib/emailverify/configuration.rb', line 5

def api_key
  @api_key
end

#base_urlObject (readonly)

Returns the value of attribute base_url.



6
7
8
# File 'lib/emailverify/configuration.rb', line 6

def base_url
  @base_url
end

#endpointsObject

Returns the value of attribute endpoints.



5
6
7
# File 'lib/emailverify/configuration.rb', line 5

def endpoints
  @endpoints
end

#loggerObject

Returns the value of attribute logger.



5
6
7
# File 'lib/emailverify/configuration.rb', line 5

def logger
  @logger
end

#timeoutObject

Returns the value of attribute timeout.



5
6
7
# File 'lib/emailverify/configuration.rb', line 5

def timeout
  @timeout
end

Instance Method Details

#apikeyObject



28
29
30
# File 'lib/emailverify/configuration.rb', line 28

def apikey
  api_key
end

#apikey=(val) ⇒ Object

ZeroBounce-style alias: allow ‘config.apikey = ’key’‘ to set api_key



24
25
26
# File 'lib/emailverify/configuration.rb', line 24

def apikey=(val)
  self.api_key = val
end