Class: Truemail::Configuration

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

Constant Summary collapse

DEFAULT_CONNECTION_TIMEOUT =
2
DEFAULT_RESPONSE_TIMEOUT =
2
DEFAULT_CONNECTION_ATTEMPTS =
2
DEFAULT_VALIDATION_TYPE =
:smtp

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Configuration

Returns a new instance of Configuration.


25
26
27
28
29
30
# File 'lib/truemail/configuration.rb', line 25

def initialize(&block)
  instance_initializer.each do |instace_variable, value|
    instance_variable_set(:"@#{instace_variable}", value)
  end
  tap(&block) if block_given?
end

Instance Attribute Details

#blacklisted_domainsObject (readonly)

Returns the value of attribute blacklisted_domains


10
11
12
# File 'lib/truemail/configuration.rb', line 10

def blacklisted_domains
  @blacklisted_domains
end

#connection_attemptsObject (readonly)

Returns the value of attribute connection_attempts


10
11
12
# File 'lib/truemail/configuration.rb', line 10

def connection_attempts
  @connection_attempts
end

#connection_timeoutObject (readonly)

Returns the value of attribute connection_timeout


10
11
12
# File 'lib/truemail/configuration.rb', line 10

def connection_timeout
  @connection_timeout
end

#default_validation_typeObject

Returns the value of attribute default_validation_type


10
11
12
# File 'lib/truemail/configuration.rb', line 10

def default_validation_type
  @default_validation_type
end

#email_patternObject (readonly)

Returns the value of attribute email_pattern


10
11
12
# File 'lib/truemail/configuration.rb', line 10

def email_pattern
  @email_pattern
end

#loggerObject

Returns the value of attribute logger


10
11
12
# File 'lib/truemail/configuration.rb', line 10

def logger
  @logger
end

#not_rfc_mx_lookup_flowObject

Returns the value of attribute not_rfc_mx_lookup_flow


23
24
25
# File 'lib/truemail/configuration.rb', line 23

def not_rfc_mx_lookup_flow
  @not_rfc_mx_lookup_flow
end

#response_timeoutObject (readonly)

Returns the value of attribute response_timeout


10
11
12
# File 'lib/truemail/configuration.rb', line 10

def response_timeout
  @response_timeout
end

#smtp_error_body_patternObject (readonly)

Returns the value of attribute smtp_error_body_pattern


10
11
12
# File 'lib/truemail/configuration.rb', line 10

def smtp_error_body_pattern
  @smtp_error_body_pattern
end

#smtp_safe_checkObject

Returns the value of attribute smtp_safe_check


23
24
25
# File 'lib/truemail/configuration.rb', line 23

def smtp_safe_check
  @smtp_safe_check
end

#validation_type_by_domainObject (readonly)

Returns the value of attribute validation_type_by_domain


10
11
12
# File 'lib/truemail/configuration.rb', line 10

def validation_type_by_domain
  @validation_type_by_domain
end

#verifier_domainObject

Returns the value of attribute verifier_domain


10
11
12
# File 'lib/truemail/configuration.rb', line 10

def verifier_domain
  @verifier_domain
end

#verifier_emailObject

Returns the value of attribute verifier_email


10
11
12
# File 'lib/truemail/configuration.rb', line 10

def verifier_email
  @verifier_email
end

#whitelist_validationObject

Returns the value of attribute whitelist_validation


23
24
25
# File 'lib/truemail/configuration.rb', line 23

def whitelist_validation
  @whitelist_validation
end

#whitelisted_domainsObject (readonly)

Returns the value of attribute whitelisted_domains


10
11
12
# File 'lib/truemail/configuration.rb', line 10

def whitelisted_domains
  @whitelisted_domains
end

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)

84
85
86
# File 'lib/truemail/configuration.rb', line 84

def complete?
  !!verifier_email
end

#validation_type_for=(settings) ⇒ Object


62
63
64
65
# File 'lib/truemail/configuration.rb', line 62

def validation_type_for=(settings)
  validate_validation_type(settings)
  validation_type_by_domain.merge!(settings)
end