Module: Eco::API::MicroCases::People::Fetch::WithEachPresent
- Included in:
- Eco::API::MicroCases::People::Fetch
- Defined in:
- lib/eco/api/microcases/people/fetch/with_each_present.rb
Instance Method Summary collapse
-
#with_each_present(entries, people, options, log_starter: false) {|entry, person| ... } ⇒ Eco::API::Organization::People
Finds those in
entriesthat already exist in the organization (people) andyields them one by one to the given block.
Instance Method Details
#with_each_present(entries, people, options, log_starter: false) {|entry, person| ... } ⇒ Eco::API::Organization::People
Note:
- it also links to
person.entrythe input dataentry.
Finds those in entries that already exist in the organization (people) and yield s them one by one to the given block.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/eco/api/microcases/people/fetch/with_each_present.rb', line 18 def with_each_present(entries, people, , log_starter: false) found = [] micro.with_each(entries, people, ) do |entry, person| if person.new? if log_starter log(:error) { "This person does not exist: #{entry.to_s(:identify)}" } end next end found << person yield(entry, person) if block_given? end people.newFrom found end |