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: notes_controller.rb
    path of file: ./repos/openstreetmap-website/app/controllers/api
    
    the code of the file until where you have to start completion: module Api
  class NotesController < ApiController
    before_action :check_api_readable
    before_action :check_api_writable, :only => [:cre
    
    def result_limit
      if params[:limit]
        if params[:limit].to_i.positive? && params[:limit].to_i <= Settings.max_note_query_limit
          params[:limit].to_i
        else
          raise OSM::APIBadUserInput, "Note limit must be between 1 and #{Settings.max_note_query_limit}"
        end