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

Alias Session send methods #919

Merged
merged 1 commit into from
Mar 9, 2023
Merged

Alias Session send methods #919

merged 1 commit into from
Mar 9, 2023

Conversation

Maumagnaguagno
Copy link
Contributor

Methods respond, respond_fail and fire_event can be aliased to send_response, send_fail_response and send_event, respectively.
Related to #890.

Methods ``respond``, ``respond_fail`` and ``fire_event`` can be aliased to ``send_response``, ``send_fail_response`` and ``send_event``, respectively.
@Maumagnaguagno Maumagnaguagno changed the title Alias Session send methods in WebSocketServer Alias Session send methods Mar 8, 2023
@ko1 ko1 requested a review from ono-max March 8, 2023 14:41
def respond req, res
send_response(req, **res)
end
alias respond send_response
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot accept this change because this change breaks existing codes.

def send_response(req, **res)
  puts req, res
end

# def respond req, res
#   send_response(req, **res)
# end

alias respond send_response

def send_response(req, **res)
  puts req, res
end

respond({}, {a: 1}) # => wrong number of arguments (given 2, expected 1) (ArgumentError)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, about that.
I wanted to test if this alias was ok, since it was similar enough to the other modifications.
I removed the offending commit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. Thank you for your contribution 👍

@ko1 ko1 merged commit ad8aeca into ruby:master Mar 9, 2023
@Maumagnaguagno Maumagnaguagno deleted the alias branch March 9, 2023 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants