gapic-generator/lib/gapic/schema/api.rb
# Given a service, find all common services that use it as a delegate.
Given a service, find all common services that use it as a delegate.
Given a service find all common services that use it as a delegate .
def common_services_for delegate
        @delegate_to_common ||= (configuration[:common_services] || {}).each_with_object({}) do |(c, d), mapping|
          (mapping[d] ||= []) << c
        end
        all_services = services
        @delegate_to_common.fetch(delegate.address.join("."), []).map do |addr|
          addr = addr.split "."
          all_services.find { |s| s.address == addr }
        end.compact.uniq
      end
def common_services_for delegate @delegate_to_common ||= ( configuration [ :common_services ] || { } ) . each_with_object ( { } ) do | ( c , d ) , mapping | ( mapping [ d ] ||= [ ] ) << c end all_services = services @delegate_to_common . fetch ( delegate . address . join ( "." ) , [ ] ) . map do | addr | addr = addr . split "." all_services . find { | s | s . address == addr } end . compact . uniq end
Given a service, find all common services that use it as a delegate.
Given a service find all common services that use it as a delegate .
delegate
<not_specific>