class RabbitMQHttpAuthBackend::App::ResponseFormatter

Attributes

response[R]

Public Class Methods

new(response) click to toggle source
# File lib/rabbitmq_http_auth_backend/app/response_formatter.rb, line 8
def initialize(response)
  @response = response
end

Public Instance Methods

call() click to toggle source
# File lib/rabbitmq_http_auth_backend/app/response_formatter.rb, line 12
def call
  action = response[0]
  tags = response[1]

  if action == :allow && tags
    "#{action} #{tags.join(' ')}"
  else
    action.to_s
  end
end