# File lib/apipie/resource_description.rb, line 91
    def to_json(method_name = nil, lang = nil)
      if method_name && !valid_method_name?(method_name)
        raise "Method #{method_name} not found for resource #{_name}"
      end

      methods = if method_name.blank?
        @_methods.collect { |key, method_description| method_description.to_json(lang) }
      else
        [@_methods[method_name.to_sym].to_json(lang)]
      end

      {
        :doc_url => doc_url,
        :api_url => api_url,
        :name => @_name,
        :short_description => Apipie.app.translate(@_short_description, lang),
        :full_description => Apipie.app.translate(@_full_description, lang),
        :version => _version,
        :formats => @_formats,
        :metadata => @_metadata,
        :methods => methods,
        :headers => _headers
      }
    end