Class: Nondisposable::Configuration

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

Constant Summary collapse

ON_CHECK_FAILURE_MODES =
[:allow, :reject].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



43
44
45
46
47
48
49
# File 'lib/nondisposable.rb', line 43

def initialize
  @error_message = "provider is not allowed"
  @additional_domains = []
  @excluded_domains = []
  @on_check_failure = :allow
  @check_parent_domains = true
end

Instance Attribute Details

#additional_domainsObject

Returns the value of attribute additional_domains.



36
37
38
# File 'lib/nondisposable.rb', line 36

def additional_domains
  @additional_domains
end

#check_parent_domainsObject

Whether to also match parent domains: with the default true, an email at x.tempmail.com is blocked when tempmail.com is on the list (checks up to DisposableDomain::PARENT_MATCH_DEPTH parent labels, never a bare TLD).



40
41
42
# File 'lib/nondisposable.rb', line 40

def check_parent_domains
  @check_parent_domains
end

#error_messageObject

Returns the value of attribute error_message.



36
37
38
# File 'lib/nondisposable.rb', line 36

def error_message
  @error_message
end

#excluded_domainsObject

Returns the value of attribute excluded_domains.



36
37
38
# File 'lib/nondisposable.rb', line 36

def excluded_domains
  @excluded_domains
end

#on_check_failureObject

Returns the value of attribute on_check_failure.



41
42
43
# File 'lib/nondisposable.rb', line 41

def on_check_failure
  @on_check_failure
end