Module: Eco::API::MicroCases::People::Fetch::WithEachLeaver
- Included in:
- Eco::API::MicroCases::People::Fetch
- Defined in:
- lib/eco/api/microcases/people/fetch/with_each_leaver.rb
Instance Method Summary collapse
-
#with_each_leaver(entries, people, options) {|person| ... } ⇒ Eco::API::Organization::People
Detects who has left the organization and
yields them one by one to the given block.
Instance Method Details
#with_each_leaver(entries, people, options) {|person| ... } ⇒ Eco::API::Organization::People
Note:
- To be used only when the input file is the full DB
- The
Entries#findmethod. If the people manager entry does not haveexternal_id, but has a matchingemailwiht some input entry (row), it won't be identified as a leaver.
Detects who has left the organization and yield s them one by one to the given block
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/eco/api/microcases/people/fetch/with_each_leaver.rb', line 18 def with_each_leaver(entries, people, ) leavers = people.map do |person| unless entries.find(person, strict: micro.strict_search?()) yield(person) if block_given? person end end.compact people.newFrom leavers end |