Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class MyError < StandardError
def initialize(**options)
p options
raise MyError, foo: :bar
Copy link

r7kamura commented May 29, 2020

$ ruby /Users/r7kamura/Desktop/raise_kwargs_test.rb
/Users/r7kamura/Desktop/raise_kwargs_test.rb:7: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/r7kamura/Desktop/raise_kwargs_test.rb:2: warning: The called method `initialize' is defined here
Traceback (most recent call last):
/Users/r7kamura/Desktop/raise_kwargs_test.rb:7:in `<main>': MyError (MyError)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment