lib/util/services.rb
# Compares the name, label, and tags of each service to the given +filter+.  The method returns +true+ if the
# +filter+ matches exactly one service, +false+ otherwise.
#
# @param [Regexp, String] filter a +RegExp+ or +String+ to match against the name, label, and tags of the services
# @param [String] required_credentials an optional list of keys or groups of keys, where at least one key from the
#                                      group, must exist in the credentials payload of the candidate service
# @return [Boolean] +true+ if the +filter+ matches exactly one service with the required credentials, +false+
#                   otherwise.
Compares the name, label, and tags of each service to the given +filter+.
Compares the name label and tags of each service to the given + filter + .
def one_service?(filter, *required_credentials)
            select(&service?(filter))
              .select(&credentials?(required_credentials))
              .one?
          end
def one_service? ( filter , * required_credentials ) select ( & service? ( filter ) ) . select ( & credentials? ( required_credentials ) ) . one? end
Compares the name, label, and tags of each service to the given +filter+.
Compares the name label and tags of each service to the given + filter + .
+true+ if the +filter+ matches exactly one service with the required credentials, +false+ otherwise.
+ true + if the + filter + matches exactly one service with the required credentials + false + otherwise .
Boolean
filter
required_credentials
required_credentials an optional list of keys or groups of keys, where at least one key from the group, must exist in the credentials payload of the candidate service
required_credentials an optional list of keys or groups of keys where at least one key from the group must exist in the credentials payload of the candidate service