class V1::PingController < ApplicationController
  def ping
    render json: { result: 'pong' }
  end
end

module V1
  class PingController < ApplicationController
    def ping
      render json: { result: 'pong' }
    end
  end
end

Use nested module/class definitions in V1:PingController
Use nested module/class definitions in V1:PingController
