Module: Eco::API::MicroCases::People::Fetch::WithEachSubordinate
- Included in:
- Eco::API::MicroCases::People::Fetch
- Defined in:
- lib/eco/api/microcases/people/fetch/with_each_subordinate.rb
Instance Method Summary collapse
-
#with_each_subordinate(supervisor, people) {|subordinate| ... } ⇒ Eco::API::Organization::People
Finds all the subordinates of
supervisor.
Instance Method Details
#with_each_subordinate(supervisor, people) {|subordinate| ... } ⇒ Eco::API::Organization::People
Note:
if supervisor is nil, it will return all people with no supervisor.
Finds all the subordinates of supervisor.
14 15 16 17 18 19 20 21 22 |
# File 'lib/eco/api/microcases/people/fetch/with_each_subordinate.rb', line 14 def with_each_subordinate(supervisor, people) people.supervisor_id( _person_id(supervisor, people) ).tap do |subordinates| subordinates.each do |subordinate| yield(subordinate) if block_given? end end end |