Skip to content

Commit

Permalink
Merge pull request #6 from thatch-health/olivier-add-error-sig
Browse files Browse the repository at this point in the history
Add signatures for `error!` and a few other methods
  • Loading branch information
olivier-thatch authored Jul 3, 2024
2 parents 51b652f + 037621d commit 3122bc3
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 3122bc3

Please sign in to comment.