Class: EmailData::Source::ActiveRecord::Collection
- Inherits:
-
Object
- Object
- EmailData::Source::ActiveRecord::Collection
- Defined in:
- lib/email_data/source/active_record.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #include?(value) ⇒ Boolean
-
#initialize(model) ⇒ Collection
constructor
A new instance of Collection.
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
67 68 69 |
# File 'lib/email_data/source/active_record.rb', line 67 def include?(value) @model.where(name: value).exists? end |