lib/sensu/api/utilities/publish_check_request.rb
# Determine the Sensu Transport publish options for a
# subscription. If a subscription begins with a Transport pipe
# type, either "direct:" or "roundrobin:", the subscription uses
# a direct Transport pipe. If a subscription does not specify a
# Transport pipe type, a fanout Transport pipe is used.
#
# @param subscription [String]
# @param message [String]
# @return [Array] containing the Transport publish options:
#   the Transport pipe type, pipe, and the message to be
#   published.
Determine the Sensu Transport publish options for a
subscription. If a subscription begins with a Transport pipe
type, either "direct:" or "roundrobin:", the subscription uses
a direct Transport pipe. If a subscription does not specify a
Transport pipe type, a fanout Transport pipe is used.
Determine the Sensu Transport publish options for a subscription . If a subscription begins with a Transport pipe type either " direct : " or " roundrobin : " the subscription uses a direct Transport pipe . If a subscription does not specify a Transport pipe type a fanout Transport pipe is used .
def transport_publish_options(subscription, message)
          _, raw_type = subscription.split(":", 2).reverse
          case raw_type
          when "direct", "roundrobin"
            [:direct, subscription, message]
          else
            [:fanout, subscription, message]
          end
        end
def transport_publish_options ( subscription , message ) _ , raw_type = subscription . split ( ":" , 2 ) . reverse case raw_type when "direct" , "roundrobin" [ :direct , subscription , message ] else [ :fanout , subscription , message ] end end
Determine the Sensu Transport publish options for a
subscription.
Determine the Sensu Transport publish options for a subscription .
containing the Transport publish options: the Transport pipe type, pipe, and the message to be published.
containing the Transport publish options : the Transport pipe type pipe and the message to be published .
Array
subscription
message
None