Skip to content

Expose API class to each HTTP method block via something like the described_class() method in rspec #1500

@al3rez

Description

@al3rez

Hey, is it possible to access to the API class using a method to prevent to add namespace resolution operator to the beginning of the class?

Actual behavior

module API
  module V1
    class APIClass < Grape::API
      get do
        ::APIClass.do_something
      end
   end
  end
end

Expected behavior

module API
  module V1
    class APIClass < Grape::API
      get do
        grape_class.do_something
      end
   end
  end
end

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions