Module: Eco::API::MicroCases::People::Fetch::WithSupervisor
- Included in:
- Eco::API::MicroCases::People::Fetch
- Defined in:
- lib/eco/api/microcases/people/fetch/with_supervisor.rb
Instance Method Summary collapse
-
#with_supervisor(value, people, strict: false) {|supervisor| ... } ⇒ nil, Ecoportal::API::V1::Person
Finds the supervisor among
peopleby using thesupervisor_idofvalue.
Instance Method Details
#with_supervisor(value, people, strict: false) {|supervisor| ... } ⇒ nil, Ecoportal::API::V1::Person
Finds the supervisor among people by using the supervisor_id of value.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/eco/api/microcases/people/fetch/with_supervisor.rb', line 15 def with_supervisor(value, people, strict: false) if (sup_id = with_supervisor_supervisor_id(value)) people.person( id: sup_id, external_id: sup_id, email: sup_id, strict: strict ) end.tap do |supervisor| yield(supervisor) if block_given? end end |