Class: RichEmailValidator::ListValidator
- Inherits:
-
Object
- Object
- RichEmailValidator::ListValidator
- Defined in:
- lib/rich_email_validator/list_validator.rb
Overview
Validates list of emails and return the valid ones
Instance Attribute Summary collapse
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#threads_count ⇒ Object
readonly
Returns the value of attribute threads_count.
Class Method Summary collapse
-
.filter(list, options = {}) ⇒ Array
Validates list of emails.
Instance Method Summary collapse
-
#filter ⇒ Array
Validates list of emails.
-
#initialize(list, options = {}) ⇒ ListValidator
constructor
Validates list of emails.
Constructor Details
#initialize(list, options = {}) ⇒ ListValidator
Validates list of emails
26 27 28 29 30 31 |
# File 'lib/rich_email_validator/list_validator.rb', line 26 def initialize(list, = {}) @list = list @threads_count = .fetch(:threads_count) { 20 } @result = [] @total_slices = (@list.size / @threads_count.to_f).ceil end |
Instance Attribute Details
#list ⇒ Object (readonly)
Returns the value of attribute list.
19 20 21 |
# File 'lib/rich_email_validator/list_validator.rb', line 19 def list @list end |
#threads_count ⇒ Object (readonly)
Returns the value of attribute threads_count.
19 20 21 |
# File 'lib/rich_email_validator/list_validator.rb', line 19 def threads_count @threads_count end |
Class Method Details
.filter(list, options = {}) ⇒ Array
Validates list of emails
14 15 16 |
# File 'lib/rich_email_validator/list_validator.rb', line 14 def filter(list, = {}) new(list, ).filter end |
Instance Method Details
#filter ⇒ Array
Validates list of emails
35 36 37 |
# File 'lib/rich_email_validator/list_validator.rb', line 35 def filter @filtered ||= run_filter end |