Class: EmailData::Source::ActiveRecord::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/email_data/source/active_record.rb

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ Collection

Returns a new instance of Collection.



63
64
65
# File 'lib/email_data/source/active_record.rb', line 63

def initialize(model)
  @model = model
end

Instance Method Details

#each(&block) ⇒ Object



71
72
73
# File 'lib/email_data/source/active_record.rb', line 71

def each(&block)
  @model.find_each(&block)
end

#include?(value) ⇒ Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/email_data/source/active_record.rb', line 67

def include?(value)
  @model.where(name: value).exists?
end