You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: api_resource_route_generator.rb
    path of file: ./repos/kitsu-server/lib/generators/rails/api_resource_route
    
    the code of the file until where you have to start completion: if defined?(::Rails::Generators::NamedBase)
  require 'rails/generators/rails/resource_route/resource_route_generator'

  module Rails
    module Generators
      class ApiResourceRouteG
    
        def add_resource_route
          return if options[:actions].present?
          route_config =  regular_class_path.collect{ |namespace| "namespace :#{namespace} do " }.join(" ")
          route_config << "jsonapi_resources :#{file_name.pluralize}"
          route_config << " end" * regular_class_path.size
          route route_config
        end
      end