Class: Nondisposable::Configuration
- Inherits:
-
Object
- Object
- Nondisposable::Configuration
- Defined in:
- lib/nondisposable.rb
Constant Summary collapse
- ON_CHECK_FAILURE_MODES =
[:allow, :reject].freeze
Instance Attribute Summary collapse
-
#additional_domains ⇒ Object
Returns the value of attribute additional_domains.
-
#check_parent_domains ⇒ Object
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).
-
#error_message ⇒ Object
Returns the value of attribute error_message.
-
#excluded_domains ⇒ Object
Returns the value of attribute excluded_domains.
-
#on_check_failure ⇒ Object
Returns the value of attribute on_check_failure.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_domains ⇒ Object
Returns the value of attribute additional_domains.
36 37 38 |
# File 'lib/nondisposable.rb', line 36 def additional_domains @additional_domains end |
#check_parent_domains ⇒ Object
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_message ⇒ Object
Returns the value of attribute error_message.
36 37 38 |
# File 'lib/nondisposable.rb', line 36 def @error_message end |
#excluded_domains ⇒ Object
Returns the value of attribute excluded_domains.
36 37 38 |
# File 'lib/nondisposable.rb', line 36 def excluded_domains @excluded_domains end |
#on_check_failure ⇒ Object
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 |