Skip to content

Commit

Permalink
Add signatures for error! and a few other methods
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-thatch committed Jul 3, 2024
1 parent 51b652f commit 037621d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions rbi/grape.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@ module Grape
end
end

module InsideRoute
sig do
params(
message: T.any(String, T::Hash[Symbol, T.untyped]),
status: T.nilable(T.any(Integer, Symbol)),
additional_headers: T.nilable(T::Hash[String, String]),
).returns(T.noreturn)
end
def error!(message, status = nil, additional_headers = nil); end

sig { params(status: T.nilable(T.any(Integer, Symbol))).returns(Integer) }
def status(status = nil); end

sig { returns(Grape::Cookies) }
def cookies; end

sig { returns(Grape::Router::Route) }
def route; end
end

module RequestResponse
module ClassMethods
sig { params(args: T.untyped, block: T.proc.bind(Grape::Endpoint).params(e: Exception).void).void }
Expand Down

0 comments on commit 037621d

Please sign in to comment.