Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add return type for has_key? methods #1038

Merged
merged 1 commit into from Jan 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/amber/router/params.cr
Expand Up @@ -41,7 +41,7 @@ module Amber::Router
query[key.to_s] = value
end

def has_key?(key : Types::Key)
def has_key?(key : Types::Key) : Bool
!!self.[key.to_s]?
end

Expand Down
2 changes: 1 addition & 1 deletion src/amber/router/session/redis_store.cr
Expand Up @@ -43,7 +43,7 @@ module Amber::Router::Session
store.hset(session_id, key.to_s, value)
end

def has_key?(key : String | Symbol)
def has_key?(key : String | Symbol) : Bool
store.hexists(session_id, key.to_s) == 1 ? true : false
end

Expand Down